]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add implementation of API method home_timeline method
authorMarcel van der Boom <marcel@hsdev.com>
Thu, 27 May 2010 17:25:45 +0000 (19:25 +0200)
committerZach Copley <zach@status.net>
Thu, 27 May 2010 18:17:49 +0000 (11:17 -0700)
plugins/TwitterBridge/twitteroauthclient.php

index d895d8c73cbbac3d754f9694f7d18884bff223d0..6b821ba181fc2306ac1a3d7988ca9f541e9a9006 100644 (file)
@@ -217,6 +217,36 @@ class TwitterOAuthClient extends OAuthClient
         return $statuses;
     }
 
+    /**
+     * 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
      *