# Read GOT tweets from US | |
newTweets <- search_tweets(q = "game of thrones", | |
retryonratelimit = T, lang = "en", | |
geocode = lookup_coords("usa", apikey = apiKey), | |
include_rts = FALSE, n = 1e5) # 1st day 3e5, to go back ~1 week | |
# Specify dir | |
dirPath <- "~/Documents/INSERT_PATH" | |
# Create dir for storage | |
if(!dir.exists(paste0(dirPath, "tweets/"))){ | |
dir.create("tweets/") | |
} | |
# Write csv with date | |
save_as_csv(newTweets, paste0(dirPath, "tweets/", Sys.Date(), ".csv"), | |
prepend_ids = TRUE, na = "", | |
fileEncoding = "UTF-8") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment