Permalink
Browse files

Minor cron fixes

  • Loading branch information...
jacobemerick committed Feb 18, 2016
1 parent 048fed2 commit e7b9880378f31ce774ed889e6a729e84549a9b34
Showing with 6 additions and 3 deletions.
  1. +4 −1 cron/fetch-github-activity.php
  2. +2 −2 cron/fetch-goodreads-activity.php
@@ -40,6 +40,9 @@
$messageShort .= '...';
}
$commitDateTime = new DateTime($commit['commit']['author']['date']);
$commitDateTime->setTimezone(new DateTimeZone('America/Phoenix'));
$db->getWrite()->perform(
"INSERT INTO `jpemeric_stream`.`changelog` " .
"(`hash`, `message`, `message_short`, `datetime`, `author`, `commit_link`) " .
@@ -48,7 +51,7 @@
'hash' => $commit['sha'],
'message' => $commit['commit']['message'],
'message_short' => $messageShort,
'datetime' => $mostRecentChangeDateTime->format('Y-m-d H:i:s'),
'datetime' => $commitDateTime->format('Y-m-d H:i:s'),
'author' => $commit['commit']['author']['name'],
'commit_link' => $commit['html_url'],
]
@@ -14,7 +14,7 @@
$reviews = simplexml_load_string($reviews, 'SimpleXMLElement', LIBXML_NOCDATA);
foreach ($reviews->channel->item as $review) {
$dateTime = new DateTime((string) $review->pubDate);
$dateTime = new DateTime((string) $review->user_read_at);
if ($dateTime <= $mostRecentReviewDateTime) {
break;
}
@@ -42,7 +42,7 @@
"INSERT INTO `jpemeric_stream`.`goodread` (`permalink`, `book_id`, `datetime`, `metadata`) " .
"VALUES (:permalink, :book_id, :datetime, :metadata)",
[
'permalink' => (string) $review->pubData,
'permalink' => (string) $review->guid,
'book_id' => (string) $review->book_id,
'datetime' => $dateTime->format('Y-m-d H:i:s'),
'metadata' => json_encode($review),

0 comments on commit e7b9880

Please sign in to comment.