I'd like to retrieve the tweets for given a hashtag and sort them from the most retweeted to the less retweeted.
The closest thing I've found is using the search call and use the type tag: E.g.: http://search.twitter.com/search.json?q=TheHashTagHere&result_type=popular
However, I'm not sure on how "popular" option works.
For instance, if it finds 100 tweets with that hashtag I believe it should show the X most retweeted tweets, and if none of those tweets have been retweeted then it should show X of them randomly (or sorted in some other way like the most recent).
Unfortunately, if follows some kind of unknown rule to identify what's popular and what not and even hashtags with thousands of tweets might return only one or two results.
I hope I made myself clear. Thanks in advance :)
PS: I'll use PHP but I think that shouldn't affect the question?
Source (Emphasis are mine)
Just call with
result_type=popular
and check therecent_retweets
node to see how popular it is.result_type=popular
will become the default in an upcome release so beware if you omit this parameter.Results with popular tweets aren't ordered chronologically. *
If you would like to always have results to show, use
result_type=mixed
: they will have theresult_type
in the "metadata" section with a value of "recent", and popular results will have "popular". A small reference about result_types:If a search query has any popular results, those will be returned at the top, even if they are older than the other results. *
*[Twitter API Announcements]
This isn't a programmatic method but rather works in the browser with a chrome extension (HackyBird) :
P.S. It'll also sort your or any other user's timeline.