views:

17

answers:

1

I am trying to check via the Twitter Javascript Api (see here) if a logged in user is following me on twitter. If not, i will display a followbutton. Right now i can't seem to find out how the command isFollowing/isFollowedBy works (see doc).

Code so far:

twttr.anywhere( function (T) {
    if(T.User.find('mashable').isFollowing){
        alert("Mashable is following current logged in User");
    }
);

Have also tried .isFollowing(), .isFollowing('username'), .isFollowing().find('username') and many many more alternatives. Nothing works so far. Can someone help me find out how to properly use this Method?

Thanks in advance!

+1  A: 

Not experienced with the API but it seems

T.User.find('mashable').isFollowing() 

would be right.

Adding a curly brace might help though, you're missing one to end the function definition:

twttr.anywhere( function (T) {
    if(T.User.find('mashable').isFollowing()){
        alert("Mashable is following current logged in User");
    }
});
Alexander Sagen
i thought myself.. but it doesn't respond with right answer. Its always false or undefined somehow. Google @anywhere Discussion... no answer so far aswell..
proxylittle