From a373e6f500e172fed02ea6c892b69af69da4f688 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sun, 11 Jan 2009 08:33:28 +0000 Subject: trac750 Automatically update Identi.ca profile box with user's latest dent --- scripts/update_facebook.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/update_facebook.php') diff --git a/scripts/update_facebook.php b/scripts/update_facebook.php index 15c0e49f8..2a1251f37 100755 --- a/scripts/update_facebook.php +++ b/scripts/update_facebook.php @@ -31,7 +31,7 @@ require_once(INSTALLDIR . '/lib/common.php'); require_once(INSTALLDIR . '/lib/facebookutil.php'); // For storing the last run date-time -$last_updated_file = "/home/zach/laconica/scripts/facebook_last_updated"; +$last_updated_file = INSTALLDIR . '/scripts/facebook_last_updated'; // Lock file name $tmp_file = "/tmp/update_facebook.lock"; @@ -54,7 +54,8 @@ $cnt = 0; while($notice->fetch()) { - $flink = Foreign_link::getByUserID($notice->profile_id, 2); + $flink = Foreign_link::getByUserID($notice->profile_id, FACEBOOK_SERVICE); + $user = $flink->getUser(); $fbuid = $flink->foreign_id; $content = $notice->content; @@ -64,6 +65,7 @@ while($notice->fetch()) { if (!preg_match('/@[a-zA-Z0-9_]{1,15}\b/u', $content) || (($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) == FOREIGN_NOTICE_SEND_REPLY)) { update_status($fbuid, $content); + update_profile_box($facebook, $fbuid, $user, $notice); $cnt++; } } -- cgit v1.2.3-54-g00ecf