Created
November 18, 2022 11:34
-
-
Save joelnitta/164e66c82e30d54c036efc8ed236bb02 to your computer and use it in GitHub Desktop.
Archive a user's friends on twitter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rtweet) | |
# Initial authorization setup, only need to do once | |
# auth_setup_default() #nolint | |
# Authorize | |
auth_as("default") | |
# Set user name | |
user_name <- "PUT USER NAME HERE" | |
# Get list of friends (users followed) | |
my_friends <- get_friends( | |
user_name, | |
n = 5000, | |
retryonratelimit = FALSE, | |
parse = TRUE, | |
verbose = TRUE) | |
# Get friends' data | |
my_friends_data <- lookup_users( | |
my_friends$to_id, | |
parse = TRUE, | |
retryonratelimit = FALSE | |
) | |
# Save friends' data | |
saveRDS(my_friends_data, "my_friends_data.RDS") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment