Functions

Function Description
blockUser Blocks a given username by the authenticated user.
callUncached Piggybacks on the base call to provide error checking for Twitter.
deleteDirectMessage Deletes a direct message that was received by the authenticated user.
deleteTweet Deletes a tweet that belongs to the authenticated user.
favoriteTweet Sets a tweet as a favorite of the authenticated user.
followUser / friendUser Follows/friends a given user by the authenticated user.
getBlockedUsers Returns a page of users that are blocked by the authenticated user.
getConfiguration Sets up information such as the length of reserved characters for URLs and media uploads.
getDirectMessage Returns a single direct messages for the given ID (must be sent to or by the authenticated user).
getDirectMessages Returns a page of direct messages sent to the authenticated user.
getFavoriteTweets Returns a page of favorite tweets of the authenticated user.
getFollowers Returns a page of followers for a given username.
getFriends Returns a page of friends (people they follow) for a given username.
getHomeTimeline Returns recent tweets from the authenticated user and everyone the authenticated user follows.
getMentions Returns the timeline of mentions for the authenticated user.
getPlace Returns information about a place.
getSentDirectMessages Returns a page of direct messages sent by the authenticated user.
getTweet Returns a single tweet.
getUser Returns information about a user.
getUserTimeline Returns recent tweets from the given user's timeline.
oAuthRedirect Redirects to the OAuth API to authenticate.
oAuthSetToken Sets token information (or an error) when provided a response code.
sendDirectMessage Sends a direct message by the authenticated user.
sendTweet Post a tweet by the authenticated user.
retweetTweet Causes the authenticated user to retweet a tweet.
searchPlaces Returns close places for a given latitude/longitude pair.
searchTweets Searches Twitter for a given query and returns tweets.
searchUsers Searches Twitter for a given query and returns users.
unblockUser Unblocks a given username by the authenticated user.
unfavoriteTweet Unsets a tweet as a favorite of the authenticated user.
unfollowUser / unfriendUser Unfollows/unfriends a given user by the authenticated user.
uploadMedia Uploads media to Twitter's hosting service.

blockUser

Blocks a given username by the authenticated user.

Return Value: A BigTreeTwitterUser object if successful.

blockUser($username)
Parameter Description
$username The username to block.

callUncached

Piggybacks on the base call to provide error checking for Twitter.

callUncached()

deleteDirectMessage

Deletes a direct message that was received by the authenticated user.

Return Value: true if successful.

deleteDirectMessage($id)
Parameter Description
$id The ID of the direct message.

deleteTweet

Deletes a tweet that belongs to the authenticated user.

Return Value: True if successful.

deleteTweet($id)
Parameter Description
$id The ID of the tweet to delete.

favoriteTweet

Sets a tweet as a favorite of the authenticated user.

Return Value: A BigTreeTwitterTweet object if successful.

favoriteTweet($id)
Parameter Description
$id The tweet ID.

followUser / friendUser

Follows/friends a given user by the authenticated user.

Return Value: A BigTreeTwitterUser object on success.

followUser / friendUser($username)
Parameter Description
$username The username to follow/friend.

getBlockedUsers

Returns a page of users that are blocked by the authenticated user.

Return Value: A BigTreeTwitterResultSet of BigTreeTwitterUser objects.

getBlockedUsers($skip_status, $params)
Parameter Description
$skip_status Whether to return the user's current tweet (defaults to true, ignoring it)
$params Additional parameters (key/value array) to pass to the the blocks/list API call.

getConfiguration

Sets up information such as the length of reserved characters for URLs and media uploads.

getConfiguration()

getDirectMessage

Returns a single direct messages for the given ID (must be sent to or by the authenticated user).

Return Value: A BigTreeTwitterDirectMessage object.

getDirectMessage($id)
Parameter Description
$id The ID of the direct message.

getDirectMessages

Returns a page of direct messages sent to the authenticated user.

Return Value: A BigTreeTwitterResultSet of BigTreeTwitterDirectMessage objects.

getDirectMessages($count, $params)
Parameter Description
$count Number of results to return (defaults to 10)
$params Additional parameters (key/value array) to pass to the the direct_messages API call.

getFavoriteTweets

Returns a page of favorite tweets of the authenticated user.

Return Value: A BigTreeTwitterResultSet of BigTreeTwitterTweets objects.

getFavoriteTweets($count, $params)
Parameter Description
$count Number of results to return (defaults to 10)
$params Additional parameters (key/value array) to pass to the the favorites/list API call.

getFollowers

Returns a page of followers for a given username.

Return Value: A BigTreeTwitterResultSet of BigTreeTwitterUser objects.

getFollowers($username, $skip_status, $params)
Parameter Description
$username The username to return followers for.
$skip_status Whether to return the user's current tweet (defaults to true, ignoring it)
$params Additional parameters (key/value array) to pass to the the followers/list API call.

getFriends

Returns a page of friends (people they follow) for a given username.

Return Value: A BigTreeTwitterResultSet of BigTreeTwitterUser objects.

getFriends($username, $skip_status, $params)
Parameter Description
$username The username to return followers for.
$skip_status Whether to return the user's current tweet (defaults to true, ignoring it)
$params Additional parameters (key/value array) to pass to the the friends/list API call.

getHomeTimeline

Returns recent tweets from the authenticated user and everyone the authenticated user follows.

Return Value: A BigTreeTwitterResultSet of BigTreeTwitterTweet objects.

getHomeTimeline($count, $params)
Parameter Description
$count The number of tweets to return (defaults to 10)
$params Additional parameters (key/value array) to pass to the the statuses/user_timeline API call.

getMentions

Returns the timeline of mentions for the authenticated user.

Return Value: A BigTreeTwitterResultSet of BigTreeTwitterTweet objects.

getMentions($count, $params)
Parameter Description
$count The number of tweets to return (defaults to 10)
$params Additional parameters (key/value array) to pass to the the statuses/mentions_timeline API call.

getPlace

Returns information about a place.

Return Value: A BigTreeTwitterPlace object.

getPlace($id)
Parameter Description
$id The place ID.

getSentDirectMessages

Returns a page of direct messages sent by the authenticated user.

Return Value: A BigTreeTwitterResultSet of BigTreeTwitterDirectMessage objects.

getSentDirectMessages($count, $params)
Parameter Description
$count Number of results to return (defaults to 10)
$params Additional parameters (key/value array) to pass to the the direct_messages/sent API call.

getTweet

Returns a single tweet.

Return Value: A BigTreeTwitterTweet object.

getTweet($id, $params)
Parameter Description
$id The ID of the tweet to return.
$params Additional parameters (key/value array) to pass to the the statuses/show API call.

getUser

Returns information about a user.

Return Value: A BigTreeTwitterUser object.

getUser($username, $id = false)
Parameter Description
$username The username ("screen_name") of a Twitter user
$id The ID of the Twitter user (replaces username if provided)

getUserTimeline

Returns recent tweets from the given user's timeline.

Return Value: A BigTreeTwitterResultSet of BigTreeTwitterTweet objects.

getUserTimeline($user_name, $count, $params)
Parameter Description
$user_name The Twitter user to retrieve tweets for.
$count The number of tweets to return (defaults to 10).
$params Additional parameters (key/value array) to pass to the the statuses/user_timeline API call.

oAuthRedirect

Redirects to the OAuth API to authenticate.

oAuthRedirect()

oAuthSetToken

Sets token information (or an error) when provided a response code.

Return Value: A stdClass object of information if successful.

oAuthSetToken()

sendDirectMessage

Sends a direct message by the authenticated user.

Return Value: $this->TweetLength will be set to the length of the tweet if it is > 140 characters.

sendDirectMessage($recipient_username, $content, $recipient_id = false)
Parameter Description
$recipient_username The recipient's username.
$content The text to tweet.
$recipient_id The recipient ID (replaces the recipient_username field).

sendTweet

Post a tweet by the authenticated user.
If the tweet content is > 140 characters will fail and return false.

Return Value: $this->TweetLength will be set to the length of the tweet if it is > 140 characters.

sendTweet($content, $image, $params)
Parameter Description
$content The text to tweet.
$image Location of a local image file to upload (optional).
$params Additional parameters (key/value array) to pass to the the statuses/update API call.

retweetTweet

Causes the authenticated user to retweet a tweet.

Return Value: True if successful.

retweetTweet($id)
Parameter Description
$id The ID of the tweet to retweet.

searchPlaces

Returns close places for a given latitude/longitude pair.

Return Value: An array of BigTreeTwitterPlace objects.

searchPlaces($latitude, $longitude, $count, $params)
Parameter Description
$latitude Latitutude
$longitude Longitude
$count The number of results to return (defaults to 20)
$params Additional parameters (key/value array) to pass to the the geo/search API call.

searchTweets

Searches Twitter for a given query and returns tweets.

Return Value: A BigTreeTwitterResultSet of BigTreeTwitterTweet objects.

searchTweets($query, $count, $type, $latitude, $longitude, $radius, $params)
Parameter Description
$query String to search for.
$count Number of results to return (defaults to 10)
$type Whether to return "recent", "popular", or "mixed" results (defaults to recent)
$latitude Latitude to search at (optional, for geolocation search)
$longitude Longitude to search at (optional, for geolocation search)
$radius How far around a given latitutde/longitude to search (in miles or kilometers, i.e. 1mi or 2km)
$params Additional parameters (key/value array) to pass to the the search/tweets API call.

searchUsers

Searches Twitter for a given query and returns users.

Return Value: A BigTreeTwitterResultSet of BigTreeTwitterUser objects.

searchUsers($query, $count, $params)
Parameter Description
$query String to search for.
$count Number of results to return (max 20, default 10)
$params Additional parameters (key/value array) to pass to the the users/search API call.

unblockUser

Unblocks a given username by the authenticated user.

Return Value: A BigTreeTwitterUser object if successful.

unblockUser($username)
Parameter Description
$username The username to unblock.

unfavoriteTweet

Unsets a tweet as a favorite of the authenticated user.

Return Value: A BigTreeTwitterTweet object if successful.

unfavoriteTweet($id)
Parameter Description
$id The tweet ID.

unfollowUser / unfriendUser

Unfollows/unfriends a given user by the authenticated user.

Return Value: A BigTreeTwitterUser object on success.

unfollowUser / unfriendUser($username)
Parameter Description
$username The username to follow/friend.

uploadMedia

Uploads media to Twitter's hosting service.
Media IDs expire after 60 minutes if not used.

Return Value: Media ID

uploadMedia($media)
Parameter Description
$media An image with maximum size of 5MB or less (PNG, JPG, WebP, GIF) or a video of 15MB or less (MP4)