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");
}
});
精彩评论