Twitter api how to get followers list by php json with example


twitter


6 Votes, Rating: 4.671 Star2 Stars3 Stars4 Stars5 Stars

Tags: ,

Twitter Api : How to get all followers list by Json

These codes done as per Twitter api documents link After developer this codes you can display your Twitter Followers on your website, blog anywhere online. just use these codes as below.

Solution code

twitter logo header Twitter api how to get followers list by php json with example

This is the url you need to use for getting all followers list http://api.twitter.com/1/statuses/followers/twitter-user-id-or-screen-name.json you guys need to change above red line with your twitter user id or screen name to get all followers of that id or screen name. its’nt simple icon smile Twitter api how to get followers list by php json with example

Codes

<script src="http://code.jquery.com/jquery-latest.js"></script>
 
$trends_url = "http://api.twitter.com/1/statuses/followers/twitter-userid-or-screen-name.json";
////// exmaple $trends_url = "http://api.twitter.com/1/statuses/followers/w3cgallery.json"; or $trends_url = "http://api.twitter.com/1/statuses/followers/22250021.json";
 
$ch = curl_init(); 
 
curl_setopt($ch, CURLOPT_URL, $trends_url);
 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
$curlout = curl_exec($ch);
 
curl_close($ch);
 
$response = json_decode($curlout, true);
 
foreach($response as $friends){
 
$thumb = $friends['profile_image_url'];
 
$url = $friends['screen_name'];
 
$name = $friends['name'];
 
?>
 
 
 
<a title="<?php echo $name;?>" href="http://www.twitter.com/<?php echo $url;?>"><img class="photo-img" src="<?php echo $thumb?>" border="0" alt="" width="40" /></a>
<?php
} 
 
?>

above codes are full working and can be used any where but your server must support json.

Share/Save/Bookmark

14 Responses to “Twitter api how to get followers list by php json with example”

  1. digital-mobile.ru says:

    digital-mobile.ru…

    Могу поделиться практическим опытом в описанной проблематике. Естественно < a href=’http://ccgenerals…

  2. Rajat subhra Chakraborti says:

    Excellent…

  3. hardeep says:

    great………..

  4. hardeep says:

    hello Sir,
    how to get logged in twitter-userid-or-screen-name rather than giving the hard code.

    Thanks!

  5. SAN says:

    Hardeep, you need to read this post, it will help how to login http://www.w3cgallery.com/w3c-blog/twitter-tricks/twitter-how-to-login-without-oauth-like-twitpic

  6. wawan says:

    I like it, How about facebook ?

  7. twittenator review says:

    Thanks for the suggestions you discuss through this website.

  8. Felix says:

    Hey, thanks for the amazing information! I did the script, but it doesn’t give me all the followers, just a few, am I doing something wrong?

  9. Aamir says:

    Not working for me. Can some body attach complete code?

  10. Get More Followers says:

    Simply want to say your article is as astounding. The clearness in your publish is just nice and that i can assume you are an expert on this subject. Fine together with your permission let me to grasp your feed to keep updated with imminent post. Thank you 1,000,000 and please carry on the gratifying work.

  11. Surjeet Verma says:

    Thank You, This is something very good. I need it and very helpful to me.

  12. get free google +1 says:

    Thanks , I’ve recently been searching for info approximately this topic for a while and yours is the greatest I’ve came upon so far. However, what concerning the bottom line? Are you certain concerning the supply?

  13. pinks says:

    hello! thank you so much.
    I used on my website.

  14. Baggabee says:

    Thanks. Very Helpful.

Leave a Reply