[twitter-dev] Accurately accessing favorites

2 views
Skip to first unread message

Chris Lott

unread,
Apr 28, 2010, 12:41:13 PM4/28/10
to Twitter Development Talk
What I have in mind is an application that will, once per week, grab
the tweets I've "favorited" and archive/post them. Is there any easy
logical way to do this? I ask because it appears that the favorites
list, when ordered through the API, is returned in the order of the
timestamp of the tweets themselves rather than the order in which the
tweet was favorites. So I can't just grab pages of favorites until I
reach the date of the most recent favorite from the week before...

Is there another way?

Taylor Singletary

unread,
Apr 28, 2010, 12:59:50 PM4/28/10
to twitter-deve...@googlegroups.com
Hi Chris,

There's currently no good way I know of to do this on your own using the API purely without caching and comparisons in your backend. The favorites endpoint returns statuses rather than "favorite objects" with embedded statuses. There's definitely value in loading them the way you intend and we'll keep that in mind for the future.

Taylor Singletary
Developer Advocate, Twitter
http://twitter.com/episod

glenn gillen

unread,
Apr 29, 2010, 3:05:15 AM4/29/10
to Twitter Development Talk
> tweet was favorites. So I can't just grab pages of favorites until I
> reach the date of the most recent favorite from the week before...
>
> Is there another way?

I was thinking of something like the following to get around it:

* retrieve user's latest `favourites_count` from users/lookup
* while favourites_count != the count you have stored || reached end
of favorites
** iterate over the favorited posts and store

But you've still got the issue of dealing with people unfavoriting
posts which will screw the whole thing up. Sounds like the only way to
make work is to iterate over the whole set and store what you're
missing, or beg and plead for the API team to store a favorited_at
datetime that you can order by.
--
Glenn
http://glenngillen.com/
Reply all
Reply to author
Forward
0 new messages