twitter - all the tweets in a specific period of time with Java -


this question has answer here:

i'm trying extract , save tweets in specific period of time specific hashtag #obama twitter in java using twitter4j.

time = 2017-01-01 2017-03-01

hashtag = #obama

i need of tweets in period of time gives me 100 tweets.

    query.setuntil("2017-03-01"); doesn't work  

public class main5 {     private final static string  consumerkey  = "********************";     private final static string  consumersecret = "****************************************";     private final static string accesstoken = "****************************************";     private final static string accesstokensecret = "****************************************";       public static void main(string[] args) throws twitterexception {          configurationbuilder configurationbuilder = new configurationbuilder()                 .setdebugenabled(true)                 .setoauthaccesstokensecret(accesstokensecret)                 .setoauthaccesstoken(accesstoken)                 .setoauthconsumerkey(consumerkey)                 .setoauthconsumersecret(consumersecret);          twitterfactory twitterfactory = new twitterfactory(configurationbuilder.build());         twitter twitter = twitterfactory.getinstance();           query query = new query("#obama");           query.setcount(10000);         query.setsince("2017-01-01");          query.setuntil("2017-03-01");        queryresult result = twitter.search(query);       (status status : result.gettweets()) {           system.out.println(status.getuser() + "\t" + status.gettext() + "\n\n*********************\n\n");       }           system.out.println(result.getcount());     } } 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -