]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Better logging for update_facebook script.
authorZach Copley <zach@controlyourself.ca>
Tue, 27 Jan 2009 22:23:37 +0000 (14:23 -0800)
committerZach Copley <zach@controlyourself.ca>
Tue, 27 Jan 2009 22:23:37 +0000 (14:23 -0800)
scripts/update_facebook.php

index d2c1c3ffb92f8390dbc6141aeae08194cb9ce47e..485b2a342d90121ca434fdd7a6199edb8969a1db 100755 (executable)
@@ -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);