开发者

Need Help finding out howto use Twitter's @anywhere isFollowing/isFollowedBy methods

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.fi开发者_如何学JAVAnd('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!


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");
    }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜