if (FALSE) {
## use bearer token to search for >18k tweets (up to 45k) w/o hitting rate limit
verified_user_tweets <- search_tweets("filter:verified", n = 30000, token = bearer_token())
## get followers (user == app)
### - USER (normal) token – rate limit 15req/15min
cnn_flw <- get_followers("cnn", n = 75000)
### - APP (bearer) token – rate limit 15req/15min
cnn_flw <- get_followers("cnn", n = 75000, token = bearer_token())
## get timelines (user < app)
### - USER (normal) token – rate limit 900req/15min
cnn_flw_data <- get_timelines(cnn_flw$user_id[1:900])
### - APP (bearer) token – rate limit 1500req/15min
cnn_flw_data <- get_timelines(cnn_flw$user_id[1:1500], token = bearer_token())
## lookup statuses (user > app)
### - USER (normal) token – rate limit 900req/15min
cnn_flw_data2 <- lookup_tweets(cnn_flw_data$status_id[1:90000])
### - APP (bearer) token – rate limit 300req/15min
cnn_flw_data2 <- lookup_tweets(cnn_flw_data$status_id[1:30000], token = bearer_token())
}
Run the code above in your browser using DataLab