Add remaining methods to Status class, phpdoc
authorMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 21 Jul 2009 16:18:04 +0000 (12:18 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 21 Jul 2009 16:18:04 +0000 (12:18 -0400)
framework/Service_Twitter/lib/Horde/Service/Twitter/Statuses.php

index 3a4a998..e4e521f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Horde_Service_Twitter_Statuses class for updating user statuses.
+ * Horde_Service_Twitter_Statuses class for updating, retrieving user statuses.
  *
  * Copyright 2009 The Horde Project (http://www.horde.org)
  *
@@ -69,10 +69,86 @@ class Horde_Service_Twitter_Statuses
         return $this->_twitter->request->post($url, $params);
     }
 
+    /**
+     * Obtain the friendsTimeline.
+     *
+     * http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-friends_timeline
+     *
+     * @param array $params  Parameters for the friends_timeline call
+     *   <pre>
+     *     since_id   - Only tweets more recent the indicated tweet id
+     *     max_id     - Only tweets older then the indeicated tweet id
+     *     count      - Only return this many tweets (twitter limit = 200)
+     *     page       - The page number to return (note there are pagination limits)
+     *   </pre>
+     * @return unknown_type
+     */
     public function friendsTimeline($params = array())
     {
         $url = $this->_endpoint . 'friends_timeline.' . $this->_format;
-        return $this->_twitter->request->get($url);
+        return $this->_twitter->request->get($url, $params);
+    }
+
+    /**
+     * Obtain the last 20 tweets from the public timeline. This is cached every
+     * 60 seconds on Twitter's servers so we should eventually ensure this is
+     * only actually requested every 60 seconds or greater.
+     *
+     * @return string
+     */
+    public function publicTimeline()
+    {
+        $url = $this->_endpoint . 'public_timeline.' . $this->_format;
+        return $this->_twitter->request->get($url):
+    }
+
+    /**
+     * Obtain the friendsTimeline.
+     *
+     * http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-user_timeline
+     *
+     * @param array $params  Parameters for the friends_timeline call
+     *   <pre>
+     *     id         - For this user id or screen name.
+     *                  Current user if left out.
+     *     user_id    - Specfies the ID of the user for whom to return the
+     *                  user_timeline. Helpful for disambiguating when a valid
+     *                  user ID is also a valid screen name.
+     *     screen_id  - Specfies the screen name of the user for whom to return
+     *                  the user_timeline. Helpful for disambiguating when a
+     *                  valid screen name is also a user ID.
+     *     since_id   - Only tweets more recent the indicated tweet id
+     *     max_id     - Only tweets older then the indeicated tweet id
+     *     count      - Only return this many tweets (twitter limit = 200)
+     *     page       - The page number to return (note there are pagination limits)
+     *   </pre>
+     * @return unknown_type
+     */
+    public function userTimeline($params = array())
+    {
+        $url = $this->_endpoint . 'user_timeline.' . $this->_format;
+        return $this->_twitter->request->get($url, $params)
+    }
+
+    /**
+     * Obtain most recent 'mentions' for the current user. (i.e. all messages
+     * that contain @username in the text).
+     *
+     * http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-mentions
+     *
+     * @param array $params  Parameters for the friends_timeline call
+     *   <pre>
+     *     since_id   - Only tweets more recent the indicated tweet id
+     *     max_id     - Only tweets older then the indeicated tweet id
+     *     count      - Only return this many tweets (twitter limit = 200)
+     *     page       - The page number to return (note there are pagination limits)
+     *   </pre>
+     * @return unknown_type
+     */
+    public function mentions($params = array())
+    {
+        $url = $this->_endpoint . 'mentions.' . $this-_format;
+        return $this->_twitter->request->get($url)
     }
 
 }