I am creating a webapp that relies on following a status timeline from twitter in php
I am making a request to the twitter using the following API call:
$since_id is equal to a stored id based on the last parsed tweet.
$req_url = 'http://twitter.com/statuses/friends_timeline.xml?count=20&page=1&since_id='.$since_id;
I have noticed that if more than 20 tweets come through since the last call i'll get the most recent 20 tweets since the last call and in turn missing those between the $since_id and the current 20.
example:
- at 0800 the last tweet parsed was 70001
- 50 tweets are made in the 10 min window since the last API call
- at 0810 i call to the API to get tweets since 70001
- it returns tweets 70031 - 70051
which causes me to miss 70002-70030
Now to the quest: Is there a way to know how many tweets have been made since the last call? If so, is there a way to make sure when I call the API that I am getting the next tweet in line and not the most recent tweets made?
language: PHP5 using: Twitter REST API