*/
class Horde_Service_Twitter_Account
{
+ /**
+ * Twitter endpoint for account api calls
+ *
+ * @var string
+ */
protected $_endpoint = 'http://twitter.com/account/';
+
+ /**
+ * The request/response format to use, xml or json.
+ *
+ * @var string
+ */
protected $_format = 'json';
+ /**
+ *
+ * @param Horde_Service_Twitter $twitter
+ */
public function __construct($twitter)
{
$this->_twitter = $twitter;
* Ends the current session, invalidates the current auth token if using
* OAuth.
*
+ * @return mixed
*/
public function endSession()
{
* Update/reset where twitter sends automatic updates to
* (im/sms etc...)
*
- * @param $device
- * @return unknown_type
+ * @TODO
+ * @param string $device
+ *
+ * @return void
*/
public function updateDeliveryDevice($device = '')
{
*
* http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-account%C2%A0update_profile
*
+ * @TODO
* @param array $profile Profile data see API docs for key-values
*
* @return string JSON representation of user's updated profile data
/**
* Const'r
*
- * @return Horde_Service_Twitter_Auth
+ * @param Horde_Serivce_Twitter $twitter
+ * @param array $config
*/
public function __construct($twitter, $config)
{
$this->_config = $config;
}
+ /**
+ * Getter
+ *
+ * @param string $value
+ *
+ * @return mixed The value of the requested property.
+ */
public function __get($value)
{
if (!empty($this->_config[$value])) {
<?php
+/**
+ *
+ * Copyright 2009 The Horde Project (http://www.horde.org)
+ *
+ * @author Michael J. Rubinsky <mrubinsk@horde.org>
+ * @license http://opensource.org/licenses/bsd-license.php BSD
+ * @category Horde
+ * @package Horde_Service_Twitter
+ */
class Horde_Service_Twitter_Exception extends Exception {
}
?>
*/
abstract class Horde_Service_Twitter_Request
{
+ /**
+ *
+ * @var Horde_Service_Twitter
+ */
protected $_twitter;
+ /**
+ * Const'r
+ *
+ * @param Horde_Service_Twitter $twitter
+ */
public function __construct($twitter)
{
$this->_twitter = $twitter;
*/
class Horde_Service_Twitter_Request_Basic extends Horde_Service_Twitter_Request
{
-
+ /**
+ *
+ * @var Horde_Service_Twitter
+ */
protected $_twitter;
+ /**
+ * Const'r
+ *
+ * @param Horde_Service_Twitter $twitter
+ */
public function __construct($twitter)
{
$this->_twitter = $twitter;
}
+ /**
+ * Perform a GET request.
+ *
+ * @param string $url The URL for the request
+ * @param array $params
+ *
+ * @return mixed The response
+ */
public function get($url, $params = array())
{
$key = md5($url . 'get' . serialize($params) . $this->_twitter->auth->username);
return $body;
}
+ /**
+ * Perform a POST request
+ *
+ * @see self::get
+ */
public function post($url, $params = array())
{
$client = new Horde_Http_Client();
*/
class Horde_Service_Twitter_Request_Oauth extends Horde_Service_Twitter_Request
{
-
+ /**
+ *
+ * @var Horde_Service_Twitter
+ */
protected $_twitter;
+ /**
+ * Const'r
+ *
+ * @param Horde_Service_Twitter $twitter
+ */
public function __construct($twitter)
{
$this->_twitter = $twitter;
}
+ /**
+ * Perform a GET request with OAuth authorization.
+ *
+ * @param string $url
+ * @param array $params
+ *
+ * @return mixed Call results.
+ */
public function get($url, $params = array())
{
$key = md5($url . 'get' . serialize($params) . serialize($this->_twitter->auth->getAccessToken()));
* Send a POST request to the twitter API. Purposely do not cache results
* from these since POST requests alter data on the server.
*
+ * @see self::get
*/
public function post($url, $params = array())
{
*/
class Horde_Service_Twitter_Statuses
{
-
+ /**
+ * Endpoint for status api requests
+ *
+ * @var string
+ */
private $_endpoint = 'http://twitter.com/statuses/';
+
+ /**
+ * Format to use json or xml
+ *
+ * @var string
+ */
private $_format = 'json';
+ /**
+ * Const'r
+ *
+ * @param Horde_Service_Twiiter $twitter
+ */
public function __construct($twitter)
{
$this->_twitter = $twitter;
/**
* Obtain the requested status
*
- * @return unknown_type
+ * @return mixed The method call results.
*/
public function show($id)
{