Hi there, I’m running a straightforward query using the REST API via Twitter4J. I’ve noticed that in the past two days, sometimes fewer responses are being returned than expected, and moreover, matching tweets only go back a few hours instead of 7 days or so. For example, I ran my search for “graphene” at 6:15pm EST on 11/1/2013 and received only 89 results, the first of which was created at Fri Nov 01 11:54:29 EDT 2013. So, as you can see, the first matching tweets occur about 6 hours ago.
Has something changed recently? My sample code is below.
Many thanks,
Sanjay
private void search() {
// The factory instance is re-useable and thread safe.
Twitter twitter = TwitterFactory.getSingleton();
twitter4j.Query query = new twitter4j.Query("graphene");
QueryResult result = null;
int c = 0;
do {
try {
result = twitter.search(query);
} catch (TwitterException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return;
}
for (Status status : result.getTweets()) {
System.out.println(status.getCreatedAt() + " @" + status.getUser().getScreenName() + ":" + status.getText());
c++;
}
} while ((query = result.nextQuery()) != null);
System.out.println ("count is " + c);
}