From 09fc481443edf35508b08d4a45daaf4d54fcd516 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 31 Oct 2018 23:31:56 -0500 Subject: [PATCH] Get rolling on Twitter... --- bin/gfk-publicstuff.R | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/gfk-publicstuff.R b/bin/gfk-publicstuff.R index 0a3a5c3..2934d22 100644 --- a/bin/gfk-publicstuff.R +++ b/bin/gfk-publicstuff.R @@ -6,6 +6,7 @@ library(jsonlite) library(rjson) library(dplyr) +library(twitteR) # Grab city view for Grand Forks 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 +# 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 = "", + access_token = "", + consumer_secret = "", + access_secret = "") # After tweeting, write a small text file that has the last timestamp that was tweeted. Use that for grabbing future requests.