summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMarcel van der Boom <marcel@hsdev.com>2010-05-27 19:25:45 +0200
committerZach Copley <zach@status.net>2010-05-27 11:17:49 -0700
commitbcca10f5268ac2c2945479dd93d2f302478e02f9 (patch)
treed0070cbcd4fccab674b7795ddbe6b0eef1c786c7 /plugins
parentcef2ded9e79b2d84fddd6e7f5af09c02c50315a8 (diff)
Add implementation of API method home_timeline method
Diffstat (limited to 'plugins')
-rw-r--r--plugins/TwitterBridge/twitteroauthclient.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/TwitterBridge/twitteroauthclient.php b/plugins/TwitterBridge/twitteroauthclient.php
index d895d8c73..6b821ba18 100644
--- a/plugins/TwitterBridge/twitteroauthclient.php
+++ b/plugins/TwitterBridge/twitteroauthclient.php
@@ -218,6 +218,36 @@ class TwitterOAuthClient extends OAuthClient
}
/**
+ * Calls Twitter's /statuses/home_timeline API method
+ *
+ * @param int $since_id show statuses after this id
+ * @param int $max_id show statuses before this id
+ * @param int $cnt number of statuses to show
+ * @param int $page page number
+ *
+ * @return mixed an array of statuses, similare to friends_timeline, except including retweets
+ */
+ function statusesHomeTimeline($since_id = null, $max_id = null,
+ $cnt = null, $page = null)
+ {
+
+ $url = 'https://twitter.com/statuses/home_timeline.json';
+ $params = array('since_id' => $since_id,
+ 'max_id' => $max_id,
+ 'count' => $cnt,
+ 'page' => $page);
+ $qry = http_build_query($params);
+
+ if (!empty($qry)) {
+ $url .= "?$qry";
+ }
+
+ $response = $this->oAuthGet($url);
+ $statuses = json_decode($response);
+ return $statuses;
+ }
+
+ /**
* Calls Twitter's /statuses/friends API method
*
* @param int $id id of the user whom you wish to see friends of