Using the twitter API (and OAuth) if i was to call for the user followers, (statuses/followers) i would be returned only 99 results.
Is there a way i can return 99, then call again starting at follower 100 then looping through this style of calling until the total number of followers has been returned?
Or just return ALL followers?
You need to specify cursor parameter as described in the API documrnation. E.g. specify cursor=-1 to request the first page and then use a next_cursor value returned in the first response:
http://twitter.com/statuses/followers/barackobama.xml?cursor=-1
http://twitter.com/statuses/followers/barackobama.xml?cursor=1300794057949944903
<?php
$trends_url = "http://api.twitter.com/1/statuses/followers/fawadghafoor.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 } ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With