ishani_v
asked on
How do you get the followers number of followers in Twitter using twitteroauth?
Hi,
I am using abraham's twitteroauth library to integrate my application with Twitter. I have successfully managed to complete authentication and post tweets. Now I am trying to pull out some user statistics like number of followers, following, tweets, retweets, etc.
But I cannot see any direct method to pull out our followers number of followers. Say if person A follows me, then I am interested in knowing the number of followers person A has.
Does any one has any idea on how to do this. Any help would be appreciated.
Thanks in advance.
I am using abraham's twitteroauth library to integrate my application with Twitter. I have successfully managed to complete authentication and post tweets. Now I am trying to pull out some user statistics like number of followers, following, tweets, retweets, etc.
But I cannot see any direct method to pull out our followers number of followers. Say if person A follows me, then I am interested in knowing the number of followers person A has.
Does any one has any idea on how to do this. Any help would be appreciated.
Thanks in advance.
Hi,
you can also try with this..
See this: http://api.twitter.com/1/users/show.json?screen_name=
It returns a json object which you can use to get the followers count.
Here, the count is stored in ‘followers_count’
you can also try with this..
See this: http://api.twitter.com/1/users/show.json?screen_name=
It returns a json object which you can use to get the followers count.
Here, the count is stored in ‘followers_count’
(just en passant)
If your program does not work under IE9, check with FF. There was once a problem with IE9 where twitter API returned a json object that IE did not andle correctly. This problem has been solved... but maybe not for the complete API
See https://www.experts-exchange.com/questions/27277495/Twitter-profile-widget-appears-blank-in-IE9.html
If your program does not work under IE9, check with FF. There was once a problem with IE9 where twitter API returned a json object that IE did not andle correctly. This problem has been solved... but maybe not for the complete API
See https://www.experts-exchange.com/questions/27277495/Twitter-profile-widget-appears-blank-in-IE9.html
ASKER
@h4hardy
Thanks for your reply. But your code doesn't seem to be working. I would like to make myself clear again that I already have the code to get count of followers for a particular user. What I want is that I want to see the no of followers for the people who I am following.
Can that be done? I have attached my code that displays to me my number of followers. I want a count that shows the no of followers for any of the people I'm following.
Thanks.
Thanks for your reply. But your code doesn't seem to be working. I would like to make myself clear again that I already have the code to get count of followers for a particular user. What I want is that I want to see the no of followers for the people who I am following.
Can that be done? I have attached my code that displays to me my number of followers. I want a count that shows the no of followers for any of the people I'm following.
Thanks.
$credentials = $oauth->get("account/verify_credentials");
$content = $oauth->get('statuses/user_timeline');
foreach ($content as $item)
{ // ---- start foreach ----
//No of Followers
$followers = $item->user->followers_count;
}
echo "<br>Followers: <strong>". $followers ."</strong> \r\n";
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you can try with the below code,
Open in new window