Hi - quick question regarding the 'Working with Timelines' document. In the last example, using the since_id with the max_id how would you know what the max_id is? Let's say I use the same example: so I have already processed 10 tweets, now I wait some time, then I want to pull in from where I left off, so I do a count=5 and since_id=10. If 8 new tweets came in after tweet 10, how do I know there are 3 tweets I am going to miss in the next count=5? The 'Working with Timelines' conveniently uses a max_id of (14-1)=13 to know that tweets 11-13 were missed, but HOW did that number get derived? Or how CAN I know that without wasting so many API calls in guessing the amount of Tweets missed. I guess a simpler way of asking this is - how do I track the max_id? Hope that makes sense or maybe there is some aspect I am not quite following,
~Steve
Replies
Hi - does my question make sense? Anyone?
In this case, your initial request after some time wouldn't include a max_id -- you would just include your most recently known since_id (or even optionally omit both). Once you had gotten the most recent "page" of tweets, you would work your way backwards in time, setting the oldest tweet ID from that page as the max_id and rewinding from there. You can also do some educated "guesswork" using a tool like this: https://github.com/client9/snowflake2time
Thanks @episod, I think you answered it and that's what I was getting at. I guess there isn't an accurate way to know exactly how many tweets came in during the "wait", without just guessing...So, it seems almost every time you do a series of calls to the home_timeline there would be at least one wasted call or partially wasted call, unless the number of tweets was exactly divisible by the 'count' chosen. I was trying to develop the most efficient way to a) capture every tweet and b) minimize the number of calls to the API (since it is pretty heavily rate limited - with reason though, I guess)...Thanks again!