New way to get highest id?

1 view
Skip to first unread message

Brian Morearty

unread,
Mar 3, 2010, 10:20:03 PM3/3/10
to Twitter Development Talk
With the upcoming deprecation of /statuses/public_timeline that was
just announced, will there be any way to find out the (approximate)
highest tweet id?

I know the streaming API would work but it seems like overkill.

Scenario: in my app I cache tweets for performance and to avoid over-
calling the API. If someone references a tweet whose id doesn't exist
(e.g. by searching), I'd like to be able to tell the difference
between "that tweet was deleted" and "that tweet id has never been
used yet."

I currently poll the public_timeline once every few minutes. Ids that
are missing but are lower than the highest one are considered
deleted.

As you can see based on my current mechanism, exact precision doesn't
matter much to me.

A better alternative for this use case would be a "deleted" indicator
(perhaps in the HTTP code?) if I try to retrieve a tweet that has been
deleted. It could be different than the code returned if a tweet had
never been created.

Chris Thomson

unread,
Mar 4, 2010, 7:01:45 PM3/4/10
to Twitter Development Talk
You could always poll the search API occasionally for a very common
term like 'what' and just take the most recent tweet ID from that.
Reply all
Reply to author
Forward
0 new messages