Permalink
Browse files

cron bewaard nu ook de gebruikersnaam (db schema update)

  • Loading branch information...
futtta committed Sep 27, 2017
1 parent 6f88579 commit 772f2f5a02b44b2c5f4639641b42b4a51a11fca2
Showing with 4 additions and 3 deletions.
  1. +4 −3 cron.php
View
@@ -20,7 +20,7 @@
$lastDate = strtotime($database->max("posts","time"));
//Request feed from facebook
$data = fetchUrl("https://graph.facebook.com/" . $fbGroupID . "/feed?limit=100&since=" . $lastDate . "&access_token=" . $appID . "|" . $appSecret);
$data = fetchUrl("https://graph.facebook.com/" . $fbGroupID . "/feed?limit=100&fields=from,message,updated_time,id&since=" . $lastDate . "&access_token=" . $appID . "|" . $appSecret);
$data = json_decode($data, true)["data"];
//Load data from gemeentes
@@ -87,11 +87,12 @@ function checkNameinText($cityData, $postData)
"gemeente" => $cityData["name"],
"postID" => $id[1],
"time" => date("Y-m-d H:i:s", strtotime($postData["updated_time"])),
"text" => $postData["message"]
"text" => $postData["message"],
"auteur" => $postData["from"]["name"]
));
} else {
$database->update("posts",
array("text" => $postData["message"], "time" => date("Y-m-d H:i:s", strtotime($postData["updated_time"]))),
array("text" => $postData["message"], "auteur" => $postData["from"]["name"], "time" => date("Y-m-d H:i:s", strtotime($postData["updated_time"]))),
array("postID" => $id[1], "gemeente" => $cityData["name"], "zipcode" => $cityData["zipcode"])
);
}

1 comment on commit 772f2f5

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Sep 27, 2017

Owner

@thunderbug
db "posts" table structure verandering nodig:
auteur varchar(255) DEFAULT NULL

Owner

futtta commented on 772f2f5 Sep 27, 2017

@thunderbug
db "posts" table structure verandering nodig:
auteur varchar(255) DEFAULT NULL

Please sign in to comment.