1

Im using jquery/JS to grab the latest tweets of a account, but I want to filter them by hashtag instead.

my getJson call is: http://twitter.com/status/user_timeline/sustrans.json?count=2

I can't seem to find the documentation that says to filter these by a hastag value...

Any ideas?

Thanks

Owzzz
  • 177
  • 1
  • 4
  • 15
  • there is no hashtag in the text in given link – xkeshav May 17 '11 at 10:40
  • 1
    Look at [this](http://stackoverflow.com/questions/3540618/does-the-twitter-api-allow-filtering-by-username-and-hashtag) – Manoj May 17 '11 at 10:50
  • 1
    Possible duplicate of http://stackoverflow.com/questions/2714471/twitter-api-display-all-tweets-with-a-certain-hashtag – Tim May 17 '11 at 10:57

1 Answers1

0

You can use the search api e.g.

http://search.twitter.com/search.json?q=%23myhashtag+from:myusername

But it will only return Tweets from the past 24 hours.

The alternative is to to get the whole timeline and pull out the Tweets you want.

var tweets = []
$.getJSON('http://twitter.com/status/user_timeline/sustrans.json?callback=?', function(data){
  for(i in data) {
    if(data[i].text.indexOf('#hastag') > -1) {
      tweets.push(data[i]);
    }
  }
});
benjamunky
  • 260
  • 2
  • 12