Twitter API search user's tweets between dates
Is there a way to get tweets for a certain user between dates? I tried using Search API, but no success. The user's timeline api does not have date parameters.
The only way that I found is get the 200 most recent tweets of the user and check by parsing date.
$.getJSON(
'http://twitter.com/status/user_timeline/' + account_name + '.json?callback=?',
function(data){
if (!data || data.length === 0)
return false;
var date = new Date(data[0].created_at);
//[Date comparison goes here]
}
);
I thi开发者_高级运维nk there is a better way to to this, but searching not helped at all.
The search API supports this, but you have to assemble your query like so:
http://search.twitter.com/search.json?q=+from%3Atwitterapi+since%3A2011-06-20+until%3A2011-06-20
The query string above is the urlencoded form of:
q= from:twitterapi since:2011-06-20 until:2011-06-20
The list of search operators can be found here.
精彩评论