Class Zend_Service_Twitter

Description
  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Service/Twitter.php (line 45)

Zend_Service_Abstract
   |
   --Zend_Rest_Client
      |
      --Zend_Service_Twitter
Class Constant Summary
 OAUTH_BASE_URI = 'http://twitter.com/oauth'
Variable Summary
Method Summary
 void __construct ([ $options = null], [ $consumer = null])
 Zend_Rest_Client_Result blockBlocking ([integer $page = 1], [boolean $returnUserIds = false])
 Zend_Rest_Client_Result blockCreate (integer|string $id)
 Zend_Rest_Client_Result blockDestroy (integer|string $id)
 Boolean|Zend_Rest_Client_Result blockExists (string|integer $id, [boolean $returnResult = false])
 Zend_Rest_Client_Result directMessageNew (int|string $user, string $text)
 Zend_Rest_Client_Result directMessageSent ([ $params = array()])
 Zend_Rest_Client_Result favoriteFavorites ([ $params = array()])
 Zend_Rest_Client_result friendshipExists (int|string $id)
 string getUsername ()
 bool isAuthorised ()
 self setLocalHttpClient ( $client)
 void statusFriendsTimeline ([ $params = array()])
 Zend_Rest_Client_Result statusReplies ([ $params = array()])
 Zend_Rest_Client_Result statusUpdate (string $status, [ $inReplyToStatusId = null], int $in_reply_to_status_id)
 Zend_Rest_Client_Result userFollowers ([bool $lite = false])
 Zend_Rest_Client_Result userFriends ([ $params = array()], int|string $id)
 Zend_Rest_Client_Result userShow (int|string $id)
 Zend_Http_Response _get (string $path, [ $query = null])
 void _init ()
 Zend_Http_Response _performPost (mixed $method, [mixed $data = null])
 Zend_Http_Response _post (string $path, [mixed $data = null])
 void _prepare (string $path)
 void _setDate (int|string $value)
 string _validateScreenName (string $name)
 integer _validInteger ($int $int)
 mixed __call (string $method, array $params)
 Zend_Service_Twitter __get (string $type)
Variables
Zend_Http_CookieJar $_cookieJar (line 66)
  • access: protected
string $_dateFormat = 'D, d M Y H:i:s T' (line 73)

Date format for 'since' strings

  • access: protected
Zend_Http_Client $_localHttpClient = null (line 123)

Local HTTP Client cloned from statically set client

  • access: protected
string $_methodType (line 87)

Current method type (for method proxying)

  • access: protected
array $_methodTypes = array(
'status',
'user',
'directMessage',
'friendship',
'account',
'favorite',
'block'
)
(line 101)

Types of API methods

  • access: protected
Zend_Oauth_Consumer $_oauthConsumer = null (line 94)

Zend_Oauth Consumer

  • access: protected
array $_options = array() (line 116)

Options passed to constructor

  • access: protected
string $_username (line 80)

Username

  • access: protected

Inherited Variables

Inherited from Zend_Rest_Client

Zend_Rest_Client::$_data
Zend_Rest_Client::$_uri

Inherited from Zend_Service_Abstract

Zend_Service_Abstract::$_httpClient
Methods
Constructor __construct (line 131)

Constructor

  • access: public
void __construct ([ $options = null], [ $consumer = null])

Redefinition of:
Zend_Rest_Client::__construct()
Constructor
accountEndSession (line 760)

End current session

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
true accountEndSession ()
accountRateLimitStatus (line 773)

Returns the number of api requests you have left per hour.

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result accountRateLimitStatus ()
accountVerifyCredentials (line 747)

Verify Account Credentials

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result accountVerifyCredentials ()
blockBlocking (line 904)

Returns an array of user objects that the authenticating user is blocking

  • access: public
Zend_Rest_Client_Result blockBlocking ([integer $page = 1], [boolean $returnUserIds = false])
  • integer $page: Optional. Specifies the page number of the results beginning at 1. A single page contains 20 ids.
  • boolean $returnUserIds: Optional. Returns only the userid's instead of the whole user object
blockCreate (line 850)

Blocks the user specified in the ID parameter as the authenticating user.

Destroys a friendship to the blocked user if it exists.

  • access: public
Zend_Rest_Client_Result blockCreate (integer|string $id)
  • integer|string $id: The ID or screen name of a user to block.
blockDestroy (line 864)

Un-blocks the user specified in the ID parameter for the authenticating user

  • access: public
Zend_Rest_Client_Result blockDestroy (integer|string $id)
  • integer|string $id: The ID or screen_name of the user to un-block.
blockExists (line 879)

Returns if the authenticating user is blocking a target user.

  • access: public
Boolean|Zend_Rest_Client_Result blockExists (string|integer $id, [boolean $returnResult = false])
  • string|integer $id: The ID or screen_name of the potentially blocked user.
  • boolean $returnResult: Instead of returning a boolean return the rest response from twitter
directMessageDestroy (line 687)

Destroy a direct message

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result directMessageDestroy (int $id)
  • int $id: ID of message to destroy
directMessageMessages (line 599)

Retrieve direct messages for the current user

$params may include one or more of the following keys

  • since_id: return statuses only greater than the one specified
  • page: return page X of results

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result directMessageMessages ([ $params = array()])
  • array $params
directMessageNew (line 661)

Send a direct message to a user

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • throws: Zend_Service_Twitter_Exception if message is too short or too long
  • access: public
Zend_Rest_Client_Result directMessageNew (int|string $user, string $text)
  • int|string $user: User to whom to send message
  • string $text: Message to send to user
directMessageSent (line 631)

Retrieve list of direct messages sent by current user

$params may include one or more of the following keys

  • since_id: return statuses only greater than the one specified
  • page: return page X of results

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result directMessageSent ([ $params = array()])
  • array $params
favoriteCreate (line 820)

Mark a status as a favorite

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result favoriteCreate (int $id)
  • int $id: Status ID you want to mark as a favorite
favoriteDestroy (line 835)

Remove a favorite

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result favoriteDestroy (int $id)
  • int $id: Status ID you want to de-list as a favorite
favoriteFavorites (line 791)

Fetch favorites

$params may contain one or more of the following:

  • 'id': Id of a user for whom to fetch favorites
  • 'page': Retrieve a different page of resuls

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result favoriteFavorites ([ $params = array()])
  • array $params
friendshipCreate (line 702)

Create friendship

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result friendshipCreate (int|string $id)
  • int|string $id: User ID or name of new friend
friendshipDestroy (line 717)

Destroy friendship

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result friendshipDestroy (int|string $id)
  • int|string $id: User ID or name of friend to remove
friendshipExists (line 732)

Friendship exists

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_result friendshipExists (int|string $id)
  • int|string $id: User ID or name of friend to see if they are your friend
getLocalHttpClient (line 176)

Get the local HTTP client as distinct from the static HTTP client inherited from Zend_Rest_Client

  • access: public
Zend_Http_Client getLocalHttpClient ()
getUsername (line 199)

Retrieve username

  • access: public
string getUsername ()
isAuthorised (line 186)

Checks for an authorised state

  • access: public
bool isAuthorised ()
setLocalHttpClient (line 163)

Set local HTTP client as distinct from the static HTTP client as inherited from Zend_Rest_Client.

  • access: public
self setLocalHttpClient ( $client)
setUsername (line 210)

Set username

  • access: public
Zend_Service_Twitter setUsername (string $value)
  • string $value
statusDestroy (line 516)

Destroy a status message

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result statusDestroy (int $id)
  • int $id: ID of status to destroy
statusFriendsTimeline (line 339)

Friend Timeline Status

$params may include one or more of the following keys

  • id: ID of a friend whose timeline you wish to receive
  • count: how many statuses to return
  • since_id: return results only after the specific tweet
  • page: return page X of results

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
void statusFriendsTimeline ([ $params = array()])
  • array $params
statusPublicTimeline (line 318)

Public Timeline status

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result statusPublicTimeline ()
statusReplies (line 488)

Get status replies

$params may include one or more of the following keys

  • since_id: return results only after the specified tweet id
  • page: return page X of results

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result statusReplies ([ $params = array()])
  • array $params
statusShow (line 435)

Show a single status

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result statusShow (int $id)
  • int $id: Id of status to show
statusUpdate (line 452)

Update user's current status

  • throws: Zend_Service_Twitter_Exception if message is too short or too long
  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result statusUpdate (string $status, [ $inReplyToStatusId = null], int $in_reply_to_status_id)
  • string $status
  • int $in_reply_to_status_id
  • $inReplyToStatusId
statusUserTimeline (line 385)

User Timeline status

$params may include one or more of the following keys

  • id: ID of a friend whose timeline you wish to receive
  • since_id: return results only after the tweet id specified
  • page: return page X of results
  • count: how many statuses to return
  • max_id: returns only statuses with an ID less than or equal to the specified ID
  • user_id: specfies the ID of the user for whom to return the user_timeline
  • screen_name: specfies the screen name of the user for whom to return the user_timeline

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result statusUserTimeline ([ $params = array()])
  • array $params
userFollowers (line 562)

User Followers

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result userFollowers ([bool $lite = false])
  • bool $lite: If true, prevents inline inclusion of current status for followers; defaults to false
userFriends (line 531)

User friends

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result userFriends ([ $params = array()], int|string $id)
  • int|string $id: Id or username of user for whom to fetch friends
  • array $params
userShow (line 580)

Show extended information on a user

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: public
Zend_Rest_Client_Result userShow (int|string $id)
  • int|string $id: User ID or name
_get (line 990)

Performs an HTTP GET request to the $path.

  • throws: Zend_Http_Client_Exception
  • access: protected
Zend_Http_Response _get (string $path, [ $query = null])
  • string $path
  • array $query: Array of GET parameters
_init (line 274)

Initialize HTTP authentication

  • access: protected
void _init ()
_performPost (line 1022)

Perform a POST or PUT

Performs a POST or PUT request. Any data provided is set in the HTTP client. String data is pushed in as raw POST data; array or object data is pushed in as POST parameters.

  • access: protected
Zend_Http_Response _performPost (mixed $method, [mixed $data = null])
  • mixed $method
  • mixed $data

Redefinition of:
Zend_Rest_Client::_performPost()
Perform a POST or PUT
_post (line 1005)

Performs an HTTP POST request to $path.

  • throws: Zend_Http_Client_Exception
  • access: protected
Zend_Http_Response _post (string $path, [mixed $data = null])
  • string $path
  • mixed $data: Raw data to send
_prepare (line 956)

Call a remote REST web service URI and return the Zend_Http_Response object

  • throws: Zend_Rest_Client_Exception
  • access: protected
void _prepare (string $path)
  • string $path: The path to append to the URI
_setDate (line 302)

Set date header

  • deprecated: Not supported by Twitter since April 08, 2009
  • access: protected
void _setDate (int|string $value)
  • int|string $value
_validateScreenName (line 937)

Validate a screen name using Twitter rules

  • throws: Zend_Service_Twitter_Exception
  • access: protected
string _validateScreenName (string $name)
  • string $name
_validInteger (line 922)

Protected function to validate that the integer is valid or return a 0

  • throws: Zend_Http_Client_Exception if HTTP request fails or times out
  • access: protected
integer _validInteger ($int $int)
  • $int $int
__call (line 243)

Method overloading

  • throws: Zend_Service_Twitter_Exception if unable to find method
  • access: public
mixed __call (string $method, array $params)
  • string $method
  • array $params

Redefinition of:
Zend_Rest_Client::__call()
Method call overload
__get (line 223)

Proxy service methods

  • throws: Zend_Service_Twitter_Exception If method not in method types list
  • access: public
Zend_Service_Twitter __get (string $type)
  • string $type

Inherited Methods

Inherited From Zend_Rest_Client

 Zend_Rest_Client::__construct()
 Zend_Rest_Client::getUri()
 Zend_Rest_Client::restDelete()
 Zend_Rest_Client::restGet()
 Zend_Rest_Client::restPost()
 Zend_Rest_Client::restPut()
 Zend_Rest_Client::setUri()
 Zend_Rest_Client::_performPost()
 Zend_Rest_Client::__call()

Inherited From Zend_Service_Abstract

 Zend_Service_Abstract::getHttpClient()
 Zend_Service_Abstract::setHttpClient()
Class Constants
OAUTH_BASE_URI = 'http://twitter.com/oauth' (line 61)

OAuth Endpoint

STATUS_MAX_CHARACTERS = 246 (line 56)

246 is the current limit for a status message, 140 characters are displayed initially, with the remainder linked from the web UI or client. The limit is applied to a html encoded UTF-8 string (i.e. entities are counted in the limit which may appear unusual but is a security measure).

This should be reviewed in the future...

Documentation generated on Mon, 21 Jun 2010 15:50:06 -0400 by phpDocumentor 1.4.3