Strange behavior (bug?): statuses/user_timeline/ with count

5 views
Skip to first unread message

Christian Joudrey

unread,
Feb 10, 2010, 9:38:04 PM2/10/10
to Twitter Development Talk
Hello all,

I have just ran into a strange behavior when retrieving the latest
tweet using statuses/user_timeline.

The following URL returns as expected my latest tweet:
http://twitter.com/statuses/user_timeline/cjoudrey.rss?count=1

However, when you change the output to JSON something very odd
happens:
http://twitter.com/statuses/user_timeline/cjoudrey.json?count=1

The API returns a blank array [].

What is even odder is when I poll the API with this URL:
http://twitter.com/statuses/user_timeline/cjoudrey.json?count=2

It only returns my 2nd newest tweet.

Somehow, the most latest tweet is nowhere to be found when using JSON
output.

Best regards,

Christian

Abraham Williams

unread,
Feb 12, 2010, 9:33:34 PM2/12/10
to twitter-deve...@googlegroups.com
That is because retweets are not returned in the user_timeline method. 


Abraham
--
Abraham Williams | Community Advocate | http://abrah.am
Project | Out Loud | http://outloud.labs.poseurtech.com
This email is: [ ] shareable [x] ask first [ ] private.
Sent from Seattle, WA, United States

Christian Joudrey

unread,
Feb 13, 2010, 6:53:42 PM2/13/10
to Twitter Development Talk
I understand that, but if you put count=2 it should return you 2
results regardless of whether or not it sends back retweets.

If you put count=2 and your timeline is RT, RT, Tweet it will return
an empty array while it should simply return you an array containing
the single Tweet.

On Feb 12, 9:33 pm, Abraham Williams <4bra...@gmail.com> wrote:
> That is because retweets are not returned in the user_timeline method.
>

> http://apiwiki.twitter.com/Twitter-REST-API-Method:-statuses-user_tim...
>
> Abraham

Abraham Williams

unread,
Feb 14, 2010, 1:05:34 PM2/14/10
to twitter-deve...@googlegroups.com
My understanding is that retweets are filtered after timeline is built. So it selects two statuses to return then filters the retweets and ends up with an empty result set. Currently if you are not getting enough results you can increase the number and discard extra statuses or make extra calls. I would imagine Twitter will stop filtering retweets when version two of the API is released.

Abraham
Reply all
Reply to author
Forward
0 new messages