Get rolling on Twitter...

This commit is contained in:
Matt
2018-10-31 23:31:56 -05:00
committed by mattbk
parent c69c5b7d6a
commit 09fc481443

View File

@ -6,6 +6,7 @@
library(jsonlite) library(jsonlite)
library(rjson) library(rjson)
library(dplyr) library(dplyr)
library(twitteR)
# Grab city view for Grand Forks # Grab city view for Grand Forks
gfk <- rjson::fromJSON(file="https://www.publicstuff.com/api/2.1/city_view?space_id=15174") gfk <- rjson::fromJSON(file="https://www.publicstuff.com/api/2.1/city_view?space_id=15174")
@ -40,6 +41,13 @@ gfk_requests <- bind_rows(gfk_requests)
#### Tweeting #### Tweeting
# https://rcrastinate.blogspot.com/2018/05/send-tweets-from-r-very-short.html
# Need to create an external file with keys so they don't end up on GitHub
setup_twitter_oauth(consumer_key = "<your Consumer Key>",
access_token = "<your Acces Token>",
consumer_secret = "<your Consumer Secret>",
access_secret = "<your Access Token Secret>")
# After tweeting, write a small text file that has the last timestamp that was tweeted. Use that for grabbing future requests. # After tweeting, write a small text file that has the last timestamp that was tweeted. Use that for grabbing future requests.