Reputation: 187
I would like to know how to retrieve more than twenty tweets from twiiter. I have looked at the twitter documentation but havent been able to figure out how to do it. I have code that gets twenty tweets but cant figure out how to get more. Heres the code
$xmldata = 'http://twitter.com/statuses/user_timeline/SkySportsNews.xml';
$open = fopen($xmldata, 'r');
$content = stream_get_contents($open);
fclose($open);
$xml = new SimpleXMLElement($content);
$i = 0;
while($i < 20)
{
echo $i . $xml->status[$i]->text . "</br>";
$i++;
}
Any help is appreciated
thanks
Upvotes: 0
Views: 151
Reputation: 35409
The default number of tweets returned is 20
, to change that specify a count
query string parameter:
http://twitter.com/statuses/user_timeline/SkySportsNews.xml?count=200
It cannot exceed 200.
https://dev.twitter.com/docs/api/1/get/statuses/home_timeline
Upvotes: 1