From fd6f9b9d7622f280f92810770deb217eb7301c14 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sun, 4 Jan 2009 20:04:07 -0500 Subject: trac750 Automatically update linked Facebook users' statuses darcs-hash:20090105010407-7b5ce-559da13720b18e3c570e730326f5e5ef2b2dc1ab.gz --- lib/facebookutil.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lib/facebookutil.php (limited to 'lib/facebookutil.php') diff --git a/lib/facebookutil.php b/lib/facebookutil.php new file mode 100644 index 000000000..fc0e41e5b --- /dev/null +++ b/lib/facebookutil.php @@ -0,0 +1,40 @@ +. + */ + +require_once(INSTALLDIR.'/extlib/facebook/facebook.php'); + +// Gets all the notices from users with a Facebook link since a given ID +function get_facebook_notices($since) +{ + $qry = 'SELECT notice.* ' . + 'FROM notice ' . + 'JOIN foreign_link ' . + 'WHERE notice.profile_id = foreign_link.user_id ' . + 'AND foreign_link.service = 2'; + + // XXX: What should the limit be? + return Notice::getStreamDirect($qry, 0, 100, 0, 0, null, $since); +} + +function get_facebook() +{ + $apikey = common_config('facebook', 'apikey'); + $secret = common_config('facebook', 'secret'); + return new Facebook($apikey, $secret); +} -- cgit v1.2.3-54-g00ecf