Add some more methods to Account, some stubs, some functional
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 19 Jul 2009 17:14:52 +0000 (13:14 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 19 Jul 2009 17:14:52 +0000 (13:14 -0400)
framework/Service_Twitter/lib/Horde/Service/Twitter/Account.php

index 3c8dc0e..8a6a3d1 100644 (file)
@@ -19,10 +19,68 @@ class Horde_Service_Twitter_Account
         $this->_twitter = $twitter;
     }
 
+    /**
+     * Used to verify current credentials, and obtain some basic profile
+     * information about the current user.
+     *
+     * http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-account%C2%A0verify_credentials
+     *
+     * @return string  JSON reprentation of profile.
+     */
     public function verifyCredentials()
     {
         $url = $this->_endpoint . 'verify_credentials.' . $this->_format;
         return $this->_twitter->request->get($url);
     }
 
+    /**
+     * Obtain the current user's (if authenticated) or IP address' (if not
+     * authenticated) remaining number of requests left for the hour.
+     *
+     * http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-account%C2%A0rate_limit_status
+     *
+     * @return string  JSON representation of result object.
+     */
+    public function rateLimitStatus()
+    {
+        $url = $this->_endpoint . 'rate_limit_status.' . $this->_format;
+        return $this->_twitter->request->get($url);
+    }
+
+    /**
+     * Ends the current session.
+     *
+     * @TODO: Verify that this invalidates any OAuth keys/secrets
+     *
+     */
+    public function endSession()
+    {
+        $url = $this->_endpoint . 'end_session.' . $this->_format;
+        return $this->_twitter->request->get($url);
+    }
+
+    /**
+     * Update/reset where twitter sends automatic updates to
+     * (im/sms etc...)
+     *
+     * @param $device
+     * @return unknown_type
+     */
+    public function updateDeliveryDevice($device = '')
+    {
+    }
+
+    /**
+     * Update user's profile data.
+     *
+     * http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-account%C2%A0update_profile
+     *
+     * @param array $profile  Profile data see API docs for key-values
+     *
+     * @return string  JSON representation of user's updated profile data
+     */
+    public function updateProfile($profile)
+    {
+    }
+
 }