Reputation: 14764
I have some JS that retrieves the latest 3 tweets, which is returned as JSON from Twitter.
Suddenly, today, only 2 Tweets were showing. I noticed twitter limits this latest to the last 7 days. Fine I thought, so I tweet again...however, still, only 2 tweets are showing, despite there being more than 3 tweets made in the last week.
Here is my URL I am calling:
https://twitter.com/statuses/user_timeline.json?screen_name=tokheimgroup&count=3&callback=?
If you then examine this page:
https://twitter.com/tokheimgroup
You'll notice that in the JSON returned from the first link, the re-tweet is not being returned as the 3rd tweet. Is there an additional parameter to include re-tweets?
Thanks!
Upvotes: 0
Views: 587
Reputation: 14764
It's ok, I managed to figure this out.
When getting 3 tweets (or whatever number) Twitter doesn't include by default re-tweets, but still counts to the number you're looking for. This in my opinion is wrong, but hey, that's how they have it set up.
To include retweets as part of this number, you need to set the paramaer:
include_rts=true
So now my original URL looks something like this:
https://twitter.com/statuses/user_timeline.json?screen_name=tokheimgroup&count=3&include_rts=true&callback=?
Phew!
Hope this helps someone.
Upvotes: 2