Doubt about statuses/user_timeline in REST


#1

Hi, I am developing a web application in which we introduce a username USERNAME and a number “X” and the application will return us the last X tweets user USERNAME.

First of all, the language that I’m using is PHP. Well, this does not happen with all users, but with many. For example “jorma16” when I ask 100 tweets from this user this is the query that generated:

http://gyazo.com/8c60c71dc30d7086eb62f7649f3fb8dd

I turn from json to array, I do a count of the array and returns me 98. This should return 100. What am I doing wrong? I attached the relevant part of the code.

http://gyazo.com/562473aa92bc934a6d3d361f9914c871

Another user with which is the same is “Jj88” with count = 100. Can anyone help me? Thanks!

A screenshot of all my code: http://gyazo.com/0e2224276851eed5a7a98628488f29ff


#2

Check out the documentation for statuses/user_timeline, and the count parameter in particular:

The value of count is best thought of as a limit to the number of tweets to return because suspended or deleted content is removed after the count has been applied

A few things you could do here:

  • request 200 tweets and discard older ones to get down to the 100 most recent

  • request 100; if less than 100 are returned, make a further request for more