Service/Twitter/Proxy.php
\Conjoon_Service_Twitter_Proxy
This class proxies requests to the Twitter service and takes care of returning appropriate and easy to use objects depending on the requested actions.
- Author
- Thorsten Suckow-Homberg
Properties
Methods

__construct(
array | \Zend_Config $options
)
:
voidCreates a new instance of Conjoon_Service_Twitter_Proxy
| Name | Type | Description |
|---|---|---|
| $options | array | \Zend_Config | a configuration object for this class, with at least the following key/values: - oauth_token - as provided by Twitter's oauth - oauth_token_secret - as provided by Twitter's oauth - user_id - id of the user as provided by the twitter service - screen_name - screen name of the user as provided by the twitter service |
| Exception | Description |
|---|---|
| \InvalidArgumentException | if $options was not of type array or Zend_Config or if any expected key was missing in $options |

accountVerifyCredentials(
)
:
trueVerifies account credentials.
| Type | Description |
|---|---|
| true | or Conjoon_Modules_Service_Twitter_Account_Dto |

deleteTweet(
int $id
)
:
\Conjoon_ErrorDestroy a status message.
| Name | Type | Description |
|---|---|---|
| $id | int | ID of status to destroy |
| Type | Description |
|---|---|
| \Conjoon_Error | if any error occured, otherwise Conjoon_Modules_Service_Twitter_Tweet with the data of the deleted tweet |

favoriteTweet(
int $id, boolean $favorite
=
false
)
:
\Conjoon_ErrorFavorites or unfavorites a tweet based on the $favorite parameter.
| Name | Type | Description |
|---|---|---|
| $id | int | Id of the tweet to (un)favorite |
| $favorite | boolean | true to favorite the tweet, false tounfavorite it |
| Type | Description |
|---|---|
| \Conjoon_Error | if any error occured, otherwise Conjoon_Modules_Service_Twitter_Tweet with the data of the (un)favorited tweet |
- Todo
- "favorited" in xml response returns always false as of 12-July 2009 check back later for proper return value

friendshipCreate(
int | string $id
)
:
trueCreate friendship
| Name | Type | Description |
|---|---|---|
| $id | int | string | User ID or name of new friend |
| Type | Description |
|---|---|
| true | or Conjoon_Error |

friendshipDestroy(
int | string $id
)
:
trueDestroy friendship
| Name | Type | Description |
|---|---|---|
| $id | int | string | User ID or name of friend to remove |
| Type | Description |
|---|---|
| true | or Conjoon_Error |

friendshipExists(
mixed $userId
)
:
booleanReturns true if userA follows userB, otherwise false.
| Name | Type | Description |
|---|---|---|
| $userId | mixed | either the screenName or the id of the user to check the friendship against |
| Type | Description |
|---|---|
| boolean | (true/false) or Conjoon_Error |

statusFriendsTimeline(
)
:
mixedRetrieves the recent tweets of the users followed by the authenticated user.
| Type | Description |
|---|---|
| mixed | Either an array with the recent tweets, or a Conjoon_Error object |

statusShow(
int $id
)
:
\Conjoon_ErrorShow a single status
| Name | Type | Description |
|---|---|---|
| $id | int | Id of status to show |
| Type | Description |
|---|---|
| \Conjoon_Error | if any error occures, otherwise an instance of Conjoon_Modules_Service_Twitter_Tweet |

statusUpdate(
string $status, int $in_reply_to_status_id
=
null
)
:
mixedUpdate user's current status
| Name | Type | Description |
|---|---|---|
| $status | string | |
| $in_reply_to_status_id | int |
| Type | Description |
|---|---|
| mixed | Conjoon_Error on failure, or an Conjoon_Modules_Service_Twitter_Tweet object on success |

statusUserTimeline(
array $params
=
array()
)
:
\Conjoon_ErrorReturns the recent tweets of the user with the speified id.
| Name | Type | Description |
|---|---|---|
| $params | array | A list of parameters to send to the Twitter service |
| Type | Description |
|---|---|
| \Conjoon_Error | if any error occures, otherwise an array with the Conjoon_Modules_Service_Twitter_Tweet objects |