0

I am using this to get my latest Tweets

<script type="text/javascript"  src="http://twitter.com/javascripts/blogger.js" ></script>

<script type="text/javascript"src="http://twitter.com/statuses/user_timeline/username.json?callback=twitterCallback2&amp;count=2"></script>

so i have to get the latest 2 tweets cause i set the count to 2 , sometimes it returns only 1 why is that ?

ahmedelgabri
  • 1,228
  • 3
  • 17
  • 30
  • Are you actually using `&` in your url? If so, you should change it to just `&` for starters; – Jeff B Mar 25 '10 at 00:12
  • @Jeff: Actually URIs should be encoded with `&` if using strict XHTML: http://stackoverflow.com/questions/275150/xhtml-and-ampersand-encoding – Daniel Vassallo Mar 25 '10 at 00:14
  • Ah, thanks. I never thought about it, but this sums it up pretty nicely: http://htmlhelp.com/tools/validator/problems.html#amp – Jeff B Mar 25 '10 at 00:19

1 Answers1

2

I actually ran into this same problem today it's in the documentation that twitter doesn't return re-tweets in the list for backwards compatibility:

count. Optional. Specifies the number of statuses to retrieve. May not be greater than 200. (Note the the number of statuses returned may be smaller than the requested count as retweets are stripped out of the result set for backwards compatibility.)

http://apiwiki.twitter.com/Twitter-REST-API-Method:-statuses-user_timeline

That could be what's causing it for you.

William
  • 6,338
  • 4
  • 32
  • 36
  • actually sometimes retweets appear and sometimes my tweets doesn`t appear , that`s what make it weird – ahmedelgabri Mar 27 '10 at 12:01
  • Could the difference be re-tweets you do by convention i.e. putting RT in front of the message vs. clicking the re-tweet button? – William Mar 28 '10 at 21:14