From aed6d586565a82f8824a62a7a38b58159b8565b8 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sun, 19 Jul 2009 13:14:52 -0400 Subject: [PATCH] Add some more methods to Account, some stubs, some functional --- .../lib/Horde/Service/Twitter/Account.php | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/framework/Service_Twitter/lib/Horde/Service/Twitter/Account.php b/framework/Service_Twitter/lib/Horde/Service/Twitter/Account.php index 3c8dc0ebb..8a6a3d1f6 100644 --- a/framework/Service_Twitter/lib/Horde/Service/Twitter/Account.php +++ b/framework/Service_Twitter/lib/Horde/Service/Twitter/Account.php @@ -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) + { + } + } -- 2.11.0