Hi @llrs, thank you for your answer. Sorry, my question was really unclear. I have an existing database of all German candidates for the 2021 Federal Election with their screen names. My answer referred to this code:
timeline_bo ← get_timeline(“BarackObama”, n = 100, token = auth, retryonratelimit = TRUE)
timeline_jb ← get_timeline(“justinbieber”, n = 100, token = auth, retryonratelimit = TRUE)
bo ← cbind(timeline_bo, users_data(timeline_bo)[, c(“id”, “id_str”, “name”, “screen_name”)])
jb ← cbind(timeline_jb, users_data(timeline_jb)[, c(“id”, “id_str”, “name”, “screen_name”)])
timeline_with_users ← rbind(bo, jb)
In this example, I would have to write for all 2500 politicians an extra line. So I thought I could use a for loop to solve this problem and created a list called accounts with all the screen names out of the data frame.
In the meanwhile, I created this dilettant approach with an example of three politicians. This works fine.
Create account list
accounts = c(“ABaerbockArchiv”, “OlafScholz”)
Create Master_Timeline with first account
timeline_al ← get_timeline(“ArminLaschet”, n = 100, retryonratelimit = TRUE)
master_timeline ← cbind(timeline_al, users_data(timeline_al)[, c(“id”, “id_str”, “name”, “screen_name”)])
For Loop for the rest of the Timelines
for (account in accounts) {
timeline ← get_timeline(account, n = 100, retryonratelimit = TRUE)
full_timelines ← cbind(timeline, users_data(timeline)[, c(“id”, “id_str”, “name”, “screen_name”)])
master_timeline ← rbind(master_timeline, full_timelines)
}
Do you think this will still work with +2500 Accounts and when I collect for each account all tweets to access the time period of the Election campaign from August to September 2021? Does the retryonratelimit = TRUE option solve the issue with too-large queries? I have problems with the cap of 1024 characters for one query in the academictwitteR-package.
Thank you for your help