I m listening twitter streams by coordinate using twitter4j without any input keyword, as i know twitter api just gives tweets of last 7 days. My code was working funny and i had an network problem and i could not get streams of 2 days ago. i need to get tweets of 22.04.2018 and 23.04.2018. I need to use until parameter to get these tweets but i could not see any sample of using until parameter without any input query. The following is my code statement when i listen for streams in given coordinates, how can i add until parameter to get past 2 days streams.
double latitude1 = 36.000000;
double longitude1 = 26.000000;
double latitude2 = 42.000000;
double longitude2 = 45.000000;
double[][] latlong = {{longitude1, latitude1}, {longitude2, latitude2}};
twitterStream.addListener(listener);
FilterQuery fq = new FilterQuery();
fq.locations(latlong);
twitterStream.filter(fq);
So the question is how can i use FilterQuery with until,
i tried something like as follows ;
MyConnectionBuilder myConnection = new MyConnectionBuilder();
Twitter twitter = new
TwitterFactory(myConnection.configuration.build()).getInstance();
double latitude1 = 42.000000;
double longitude1 = 45.000000;
Query query = new Query();
GeoLocation obj = new GeoLocation(latitude1, longitude1);
query.setGeoCode(obj, 2000, Unit.valueOf("km"));
query.setSince("20180421");
query.setUntil("20180422");
query.setLang("tr");
QueryResult result = twitter.search(query);
for (Status status : result.getTweets()) {
System.out.println("@" + status.getUser().getScreenName() + ":" + status.getText());
}
but nothing comes from result query, what can be wrong with these code statements ?