From ac93c319627b413471373ee7f4f2d554f9b691e2 Mon Sep 17 00:00:00 2001 From: mattbk Date: Mon, 5 Nov 2018 01:25:52 +0000 Subject: [PATCH] Use absolute paths because of cron. --- bin/post-311.R | 6 +++--- requests.sqlite | Bin 16384 -> 16384 bytes 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/post-311.R b/bin/post-311.R index 16191e7..6a3a522 100644 --- a/bin/post-311.R +++ b/bin/post-311.R @@ -17,7 +17,7 @@ library(RSQLite) ### Config # Authentication variables -auth <- read.ini("auth.ini") +auth <- read.ini("/home/pi/hack-grand-forks/auth.ini") # Grab city view for Grand Forks space_id <- 15174 client_id <- 1353 #needed later @@ -60,7 +60,7 @@ recent_requests$posted <- 0 ## Store requests in a database # Create DB if it doesn't exist, otherwise connect -mydb <- dbConnect(RSQLite::SQLite(), "requests.sqlite") +mydb <- dbConnect(RSQLite::SQLite(), "/home/pi/hack-grand-forks/requests.sqlite") # See if table exists, then get existing rows back if(nrow(dbGetQuery(mydb, "SELECT name FROM sqlite_master WHERE type='table' AND name='requests'")) > 0){ rows.exist <- dbGetQuery(mydb, 'SELECT id FROM requests')$id @@ -78,7 +78,7 @@ dbDisconnect(mydb) mastodon_token <- login(auth$mastodon$server, auth$mastodon$email, auth$mastodon$password) # Each time this script runs, take the oldest n requests, post them, and mark them in the db. -mydb <- dbConnect(RSQLite::SQLite(), "requests.sqlite") +mydb <- dbConnect(RSQLite::SQLite(), "/home/pi/hack-grand-forks/requests.sqlite") #all_requests <- dbGetQuery(mydb, 'SELECT * FROM requests') new_requests <- dbGetQuery(mydb, 'SELECT * FROM requests WHERE posted <> 1 ORDER BY date_created') diff --git a/requests.sqlite b/requests.sqlite index d129070b363d131c3d3f78b9c3a125ffdc136b6b..982cbb52e79d3b53cb61acad3a3b997744c9379d 100644 GIT binary patch delta 348 zcmZo@U~Fh$oFL7pJyFJ)QF~*;5`6_ehOG>I^1LxTRop>bDV!%cnK&}oPqQ1a9%1od z5@Fanv2bF2Q;ehpGp}}2th~OmI12{{2Rl2E;FoU{h=!!pqTFJLb$SX4AsLBz*~N;A#idEPnLtBRjLnS9 z6%@QPbAjq|Dixed+=~){R=DLCWfz-T7#WBfM&CDo=HUL(?M`fR$AJhZi`hX8b(7=8 R-C0ddEG;ZHix|D(1pqXsbB_Q3 delta 59 zcmZo@U~Fh$oFL7pIZ?)$QFCL$5`8&dCJ_ccdEOYFD()bz6wZ^JOdJ{Pr`ZiykFa