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
# Wed May 8 21:22:45 2019 ------------------------------ | |
# Use status_id to identify and exclude duplicates | |
library(rtweet) | |
# List all files | |
allFiles <- paste0("tweets/", list.files("tweets/")) | |
# Write function to merge tweets | |
mergeTweets <- function(recipient, donor){ | |
idx <- !donor$status_id %in% recipient$status_id |
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 |
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
# Google Maps API https://developers.google.com/maps/documentation/javascript/get-api-key | |
apiKey <- "INSERT_HERE" |
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
#!/Library/Frameworks/R.framework/Resources/Rscript | |
# Mon Apr 15 18:41:47 2019 ------------------------------ | |
library(rtweet) | |
# Twitter API | |
create_token(app = "INSERT_HERE", | |
consumer_key = "INSERT_HERE", | |
consumer_secret = "INSERT_HERE", | |
access_token = "INSERT_HERE", | |
access_secret = "INSERT_HERE") |
NewerOlder