From 421e33f145de0476088f0b802f0b0a9303372b8a Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 6 Aug 2009 07:03:05 +0000 Subject: - Rewrote SyncTwitterFriends as a daemon - Made it use OAuth - Code clean up --- lib/twitteroauthclient.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'lib/twitteroauthclient.php') diff --git a/lib/twitteroauthclient.php b/lib/twitteroauthclient.php index c5f114fb0..2636a3833 100644 --- a/lib/twitteroauthclient.php +++ b/lib/twitteroauthclient.php @@ -58,4 +58,44 @@ class TwitterOAuthClient extends OAuthClient return $statuses; } + function statuses_friends($id = null, $user_id = null, $screen_name = null, + $page = null) + { + $url = "https://twitter.com/statuses/friends.json"; + + $params = array('id' => $id, + 'user_id' => $user_id, + 'screen_name' => $screen_name, + 'page' => $page); + $qry = http_build_query($params); + + if (!empty($qry)) { + $url .= "?$qry"; + } + + $response = $this->oAuthGet($url); + $ids = json_decode($response); + return $ids; + } + + function friends_ids($id = null, $user_id = null, $screen_name = null, + $page = null) + { + $url = "https://twitter.com/friends/ids.json"; + + $params = array('id' => $id, + 'user_id' => $user_id, + 'screen_name' => $screen_name, + 'page' => $page); + $qry = http_build_query($params); + + if (!empty($qry)) { + $url .= "?$qry"; + } + + $response = $this->oAuthGet($url); + $ids = json_decode($response); + return $ids; + } + } -- cgit v1.2.3-54-g00ecf