summaryrefslogtreecommitdiff
path: root/scripts/update_facebook.php
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/update_facebook.php')
-rwxr-xr-xscripts/update_facebook.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/update_facebook.php b/scripts/update_facebook.php
index d2c1c3ffb..485b2a342 100755
--- a/scripts/update_facebook.php
+++ b/scripts/update_facebook.php
@@ -46,9 +46,9 @@ $facebook = getFacebook();
$current_time = time();
-$notice = getFacebookNotices(getLastUpdated());
+$since = getLastUpdated();
-print date('r', $current_time) . " Looking for notices to send to Facebook...\n";
+$notice = getFacebookNotices($since);
$cnt = 0;
@@ -81,9 +81,13 @@ while($notice->fetch()) {
}
}
-updateLastUpdated($current_time);
+if ($cnt > 0) {
+ print date('r', $current_time) .
+ ": Found $cnt new notices to send to Facebook since last run at " .
+ date('Y-m-d H:i:s', $since) . "\n";
-print "Sent $cnt notices to Facebook.\n";
+ updateLastUpdated($current_time);
+}
exit(0);