I have started using rtweet package and so far, I have had good results for my queries, languages and geocode parameters. However, I still do not know how can I collect twitter data from within the last 7 days.
For example in the next code chunk I want to extract some data for 7 days but I am not sure if the collected tweets will be since 2017-06-29 until 2017-06-05 or if they will be since 2017-06-22 until 2017-06-29:
Stream all tweets mentioning AMLO or lopezobrador for 7 days
stream_tweets("AMLO,lopezobrador",
timeout = 60*60*24*7,
file_name = "tweetsaboutAMLO.json",
parse = FALSE)
Read in the data as a tidy tbl data frame
AMLO <- parse_stream("tweetsaboutAMLO.json")
Do you know if there are any commands in rtweet to specify the time frame to use when using the search_tweets() or stream_tweets() functions?