diya
diya

Reputation: 7148

Does twitter4j provide the capability to search tweets between 2 dates

Does twitter4j provide the capability to search tweets between 2 dates (e.g. 2011-10-27 05:30:00 to 2011-10-27 06:30:00)

currently it seems to have the granularity of a date and not hours or minutes.

Upvotes: 3

Views: 4015

Answers (3)

user3032707
user3032707

Reputation: 59

query.since() works only going back a couple of days, a week or so, not more. I think the only option is to use a screen scraper.

Upvotes: 0

Madhav
Madhav

Reputation: 29

Query query=new Query("#sachin");

//Returns tweets with since the given date.  Date should be formatted as YYYY-MM-DD 

query.setSince("2012-02-20");

Upvotes: 2

Łukasz Rżanek
Łukasz Rżanek

Reputation: 5836

No, at the current version there is no way to specify date & time for searching within given range.

And that's the limitation of Twitter search API:

Notes about Search Operators

since and until

  • do not support the negation (-) operator.
  • List item should be entered in the format year-month-day or yyyy-mm-dd.
  • are assumed to be from/to 00:00 UTC.
  • cannot be set into the future. If until is in the future you will receive an HTTP 403 error with the message: {"error":"You cannot use an 'until:' date in the future"}. If since is in the future you will receive an HTTP 403 error with the message: {"error":"since_id too recent, poll less frequently"}

Upvotes: 2

Related Questions