Install GetOldTweets:
$ git clone [email protected]:Jefferson-Henrique/GetOldTweets-python.git
$ cd GetOldTweets-python
$ pip install -r requirements.txt
Run the exporter with your parameters.
Documentation is at: https://github.com/Jefferson-Henrique/GetOldTweets-python
$ python Exporter.py --username "realDonaldTrump" --since 2017-01-20
Then do your grouping and export in R.
You can round dates with these lubridate methods
library(lubridate)
library(dplyr)
library(readr)
# semicolon-separated dataframe
df <- read.csv("output_got.csv", ";", header=T)
# group by week
week_groups <- df %>%
mutate(week_name = floor_date(as.POSIXct(date), "weeks")) %>%
group_by(week_name) %>%
summarise(count = n())
write.csv(week_groups, "week_groups.csv")