Created
October 7, 2019 15:54
-
-
Save monogenea/3cc6c11516d57fc69ccbf05b89139d19 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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