Zend Framework
1.12
|
Public Member Functions | |
__construct ($options=null, Zend_Oauth_Consumer $consumer=null, Zend_Http_Client $httpClient=null) | |
Constructor. | |
__get ($type) | |
Proxy service methods. | |
__call ($method, $params) | |
Method overloading. | |
setHttpClient (Zend_Http_Client $client) | |
Set HTTP client. | |
getHttpClient () | |
Get the HTTP client. | |
getUsername () | |
Retrieve username. | |
setUsername ($value) | |
Set username. | |
isAuthorised () | |
Checks for an authorised state. | |
accountVerifyCredentials () | |
Verify Account Credentials. | |
applicationRateLimitStatus () | |
Returns the number of api requests you have left per hour. | |
blocksCreate ($id) | |
Blocks the user specified in the ID parameter as the authenticating user. | |
blocksDestroy ($id) | |
Un-blocks the user specified in the ID parameter for the authenticating user. | |
blocksIds ($cursor=-1) | |
Returns an array of user ids that the authenticating user is blocking. | |
blocksList ($cursor=-1) | |
Returns an array of user objects that the authenticating user is blocking. | |
directMessagesDestroy ($id) | |
Destroy a direct message. | |
directMessagesMessages (array $options=array()) | |
Retrieve direct messages for the current user. | |
directMessagesNew ($user, $text) | |
Send a direct message to a user. | |
directMessagesSent (array $options=array()) | |
Retrieve list of direct messages sent by current user. | |
favoritesCreate ($id) | |
Mark a status as a favorite. | |
favoritesDestroy ($id) | |
Remove a favorite. | |
favoritesList (array $options=array()) | |
Fetch favorites. | |
friendshipsCreate ($id, array $params=array()) | |
Create friendship. | |
friendshipsDestroy ($id) | |
Destroy friendship. | |
searchTweets ($query, array $options=array()) | |
Search tweets. | |
statusesDestroy ($id) | |
Destroy a status message. | |
statusesHomeTimeline (array $options=array()) | |
Friend Timeline Status. | |
statusesMentionsTimeline (array $options=array()) | |
Get status replies. | |
statusesSample () | |
Public Timeline status. | |
statusesShow ($id) | |
Show a single status. | |
statusesUpdate ($status, $inReplyToStatusId=null) | |
Update user's current status. | |
statusesUserTimeline (array $options=array()) | |
User Timeline status. | |
usersSearch ($query, array $options=array()) | |
Search users. | |
usersShow ($id) | |
Show extended information on a user. | |
Public Attributes | |
const | API_BASE_URI = 'https://api.twitter.com/1.1/' |
Base URI for all API calls. | |
const | OAUTH_BASE_URI = 'https://api.twitter.com/oauth' |
OAuth Endpoint. | |
const | STATUS_MAX_CHARACTERS = 246 |
246 is the current limit for a status message, 140 characters are displayed initially, with the remainder linked from the web UI or client. | |
Protected Member Functions | |
init () | |
Initialize HTTP authentication. | |
validInteger ($int) | |
Protected function to validate that the integer is valid or return a 0. | |
validateScreenName ($name) | |
Validate a screen name using Twitter rules. | |
prepare ($path, Zend_Http_Client $client) | |
Call a remote REST web service URI. | |
get ($path, array $query=array()) | |
Performs an HTTP GET request to the $path. | |
post ($path, $data=null) | |
Performs an HTTP POST request to $path. | |
performPost ($method, $data, Zend_Http_Client $client) | |
Perform a POST or PUT. | |
createUserParameter ($id, array $params) | |
Create a parameter representing the user. | |
Protected Attributes | |
$cookieJar | |
$dateFormat = 'D, d M Y H:i:s T' | |
$httpClient = null | |
$methodType | |
$oauthConsumer = null | |
$methodTypes | |
$options = array() | |
$username | |
__construct | ( | $options = null , |
|
Zend_Oauth_Consumer | $consumer = null , |
||
Zend_Http_Client | $httpClient = null |
||
) |
Constructor.
null | array | Zend_Config | $options | |
null | Zend_Oauth_Consumer | $consumer | |
null | Zend_Http_Client | $httpClient |
__call | ( | $method, | |
$params | |||
) |
Method overloading.
string | $method | |
array | $params |
Exception\BadMethodCallException | if unable to find method |
__get | ( | $type | ) |
Proxy service methods.
string | $type |
Exception\DomainException | If method not in method types list |
accountVerifyCredentials | ( | ) |
Verify Account Credentials.
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
applicationRateLimitStatus | ( | ) |
Returns the number of api requests you have left per hour.
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
blocksCreate | ( | $id | ) |
Blocks the user specified in the ID parameter as the authenticating user.
Destroys a friendship to the blocked user if it exists.
integer | string | $id | The ID or screen name of a user to block. |
Exception\DomainException | if unable to decode JSON payload |
blocksDestroy | ( | $id | ) |
Un-blocks the user specified in the ID parameter for the authenticating user.
integer | string | $id | The ID or screen_name of the user to un-block. |
Exception\DomainException | if unable to decode JSON payload |
blocksIds | ( | $cursor = -1 | ) |
Returns an array of user ids that the authenticating user is blocking.
integer | $cursor | Optional. Specifies the cursor position at which to begin listing ids; defaults to first "page" of results. |
Exception\DomainException | if unable to decode JSON payload |
blocksList | ( | $cursor = -1 | ) |
Returns an array of user objects that the authenticating user is blocking.
integer | $cursor | Optional. Specifies the cursor position at which to begin listing ids; defaults to first "page" of results. |
Exception\DomainException | if unable to decode JSON payload |
|
protected |
Create a parameter representing the user.
Determines if $id is an integer, and, if so, sets the "user_id" parameter. If not, assumes the $id is the "screen_name".
int | string | $id | |
array | $params |
directMessagesDestroy | ( | $id | ) |
Destroy a direct message.
int | $id | ID of message to destroy |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
directMessagesMessages | ( | array | $options = array() | ) |
Retrieve direct messages for the current user.
$options may include one or more of the following keys
array | $options |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
directMessagesNew | ( | $user, | |
$text | |||
) |
Send a direct message to a user.
int | string | $user | User to whom to send message |
string | $text | Message to send to user |
Exception\InvalidArgumentException | if message is empty |
Exception\OutOfRangeException | if message is too long |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
directMessagesSent | ( | array | $options = array() | ) |
Retrieve list of direct messages sent by current user.
$options may include one or more of the following keys
array | $options |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
favoritesCreate | ( | $id | ) |
Mark a status as a favorite.
int | $id | Status ID you want to mark as a favorite |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
favoritesDestroy | ( | $id | ) |
Remove a favorite.
int | $id | Status ID you want to de-list as a favorite |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
favoritesList | ( | array | $options = array() | ) |
Fetch favorites.
$options may contain one or more of the following:
array | $params |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
friendshipsCreate | ( | $id, | |
array | $params = array() |
||
) |
Create friendship.
int | string | $id | User ID or name of new friend |
array | $params | Additional parameters to pass |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
friendshipsDestroy | ( | $id | ) |
Destroy friendship.
int | string | $id | User ID or name of friend to remove |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
|
protected |
Performs an HTTP GET request to the $path.
string | $path | |
array | $query | Array of GET parameters |
Zend_Http_Client_Exception |
getHttpClient | ( | ) |
getUsername | ( | ) |
Retrieve username.
|
protected |
Initialize HTTP authentication.
Exception\DomainException | if unauthorised |
isAuthorised | ( | ) |
Checks for an authorised state.
|
protected |
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.
mixed | $method | |
mixed | $data |
|
protected |
Performs an HTTP POST request to $path.
string | $path | |
mixed | $data | Raw data to send |
Zend_Http_Client_Exception |
|
protected |
Call a remote REST web service URI.
string | $path | The path to append to the URI |
Zend_Http_Client | $client |
Zend_Http_Client_Exception |
Do this each time to ensure oauth calls do not inject new params
searchTweets | ( | $query, | |
array | $options = array() |
||
) |
Search tweets.
$options may include any of the following:
string | $query | |
array | $options |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
setHttpClient | ( | Zend_Http_Client | $client | ) |
setUsername | ( | $value | ) |
Set username.
string | $value |
statusesDestroy | ( | $id | ) |
Destroy a status message.
int | $id | ID of status to destroy |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
statusesHomeTimeline | ( | array | $options = array() | ) |
Friend Timeline Status.
$options may include one or more of the following keys
array | $params |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
statusesMentionsTimeline | ( | array | $options = array() | ) |
Get status replies.
$options may include one or more of the following keys
array | $options |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
statusesSample | ( | ) |
Public Timeline status.
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
statusesShow | ( | $id | ) |
Show a single status.
int | $id | Id of status to show |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
statusesUpdate | ( | $status, | |
$inReplyToStatusId = null |
|||
) |
Update user's current status.
string | $status | |
null | int | $inReplyToStatusId |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\OutOfRangeException | if message is too long |
Exception\InvalidArgumentException | if message is empty |
Exception\DomainException | if unable to decode JSON payload |
statusesUserTimeline | ( | array | $options = array() | ) |
User Timeline status.
$options may include one or more of the following keys
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
usersSearch | ( | $query, | |
array | $options = array() |
||
) |
Search users.
$options may include any of the following:
string | $query | |
array | $options |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
usersShow | ( | $id | ) |
Show extended information on a user.
int | string | $id | User ID or name |
Zend_Http_Client_Exception | if HTTP request fails or times out |
Exception\DomainException | if unable to decode JSON payload |
|
protected |
Validate a screen name using Twitter rules.
string | $name |
Exception\InvalidArgumentException |
|
protected |
Protected function to validate that the integer is valid or return a 0.
$int |
Zend_Http_Client_Exception | if HTTP request fails or times out |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
const API_BASE_URI = 'https://api.twitter.com/1.1/' |
Base URI for all API calls.
const OAUTH_BASE_URI = 'https://api.twitter.com/oauth' |
OAuth Endpoint.
const STATUS_MAX_CHARACTERS = 246 |
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...