JTwitterStatuses

Extends \JTwitterObject

Twitter API Statuses class for the Joomla Platform.

deprecated
since

3.1.4

deprecated

4.0 Use the joomla/twitter package via Composer instead

package

Joomla.Platform

Methods

__construct

Constructor.

__construct(\Joomla\Registry\Registry &$options = null, \JHttp $client = null, \JTwitterOAuth $oauth = null) 
inherited
since

3.1.4

Arguments

$options

\Joomla\Registry\Registry

$client

\JHttpThe HTTP client object.

$oauth

\JTwitterOAuthThe OAuth client.

checkRateLimit

Method to check the rate limit for the requesting IP address

checkRateLimit(string $resource = null, string $action = null) : void
inherited
since

3.1.4

throws

\RuntimeException

Arguments

$resource

stringA resource or a comma-separated list of resource families you want to know the current rate limit disposition for.

$action

stringAn action for the specified resource, if only one resource is specified.

deleteTweet

Method to delete the status specified by the required ID parameter.

deleteTweet(integer $id, boolean $trim_user = null) : array
since

3.1.4

Arguments

$id

integerThe numerical ID of the desired status.

$trim_user

booleanWhen set to true, each tweet returned in a timeline will include a user object including only the status author's numerical ID.

Response

arrayThe decoded JSON response

fetchUrl

Method to build and return a full request URL for the request. This method will add appropriate pagination details if necessary and also prepend the API url to have a complete URL for the request.

fetchUrl(string $path, array $parameters = null) : string
inherited
since

3.1.4

Arguments

$path

stringURL to inflect

$parameters

arrayThe parameters passed in the URL.

Response

stringThe request URL.

getMentions

Method to retrieve the most recent mentions for the authenticating user.

getMentions(integer $count = 20, boolean $include_rts = null, boolean $entities = null, integer $since_id, integer $max_id, boolean $trim_user = null, string $contributor = null) : array
since

3.1.4

throws

\RuntimeException

Arguments

$count

integerSpecifies the number of tweets to try and retrieve, up to a maximum of 200. Retweets are always included in the count, so it is always suggested to set $include_rts to true

$include_rts

booleanWhen set to true, the timeline will contain native retweets in addition to the standard stream of tweets.

$entities

booleanWhen set to true, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags.

$since_id

integerReturns results with an ID greater than (that is, more recent than) the specified ID.

$max_id

integerReturns results with an ID less than (that is, older than) the specified ID.

$trim_user

booleanWhen set to true, each tweet returned in a timeline will include a user object including only the status author's numerical ID.

$contributor

stringThis parameter enhances the contributors element of the status response to include the screen_name of the contributor.

Response

arrayThe decoded JSON response

getOembed

Method to get information allowing the creation of an embedded representation of a Tweet on third party sites.

getOembed(integer $id = null, string $url = null, integer $maxwidth = null, boolean $hide_media = null, boolean $hide_thread = null, boolean $omit_script = null, string $align = null, string $related = null, string $lang = null) : array

Note: either the id or url parameters must be specified in a request. It is not necessary to include both.

since

3.1.4

throws

\RuntimeException

Arguments

$id

integerThe Tweet/status ID to return embed code for.

$url

stringThe URL of the Tweet/status to be embedded.

$maxwidth

integerThe maximum width in pixels that the embed should be rendered at. This value is constrained to be between 250 and 550 pixels.

$hide_media

booleanSpecifies whether the embedded Tweet should automatically expand images which were uploaded via POST statuses/update_with_media.

$hide_thread

booleanSpecifies whether the embedded Tweet should automatically show the original message in the case that the embedded Tweet is a reply.

$omit_script

booleanSpecifies whether the embedded Tweet HTML should include a <script> element pointing to widgets.js. In cases where a page already includes widgets.js, setting this value to true will prevent a redundant script element from being included.

$align

stringSpecifies whether the embedded Tweet should be left aligned, right aligned, or centered in the page. Valid values are left, right, center, and none.

$related

stringA value for the TWT related parameter, as described in Web Intents. This value will be forwarded to all Web Intents calls.

$lang

stringLanguage code for the rendered embed. This will affect the text and localization of the rendered HTML.

Response

arrayThe decoded JSON response

getOption

Get an option from the JTwitterObject instance.

getOption(string $key) : mixed
inherited
since

3.1.4

Arguments

$key

stringThe name of the option to get.

Response

mixedThe option value.

getRateLimit

Method to retrieve the rate limit for the requesting IP address

getRateLimit(string $resource) : array
inherited
since

3.1.4

Arguments

$resource

stringA resource or a comma-separated list of resource families you want to know the current rate limit disposition for.

Response

arrayThe JSON response decoded

getRetweeters

Method to show user objects of up to 100 members who retweeted the status.

getRetweeters(integer $id, integer $count = 20, integer $cursor = null, boolean $stringify_ids = null) : array
since

3.1.4

Arguments

$id

integerThe numerical ID of the desired status.

$count

integerSpecifies the number of retweets to try and retrieve, up to a maximum of 100.

$cursor

integerCauses the list of IDs to be broken into pages of no more than 100 IDs at a time. The number of IDs returned is not guaranteed to be 100 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."

$stringify_ids

booleanSet to true to return IDs as strings, false to return as integers.

Response

arrayThe decoded JSON response

getRetweetsById

Method to get up to 100 of the first retweets of a given tweet.

getRetweetsById(integer $id, integer $count = 20, boolean $trim_user = null) : array
since

3.1.4

Arguments

$id

integerThe numerical ID of the desired status.

$count

integerSpecifies the number of tweets to try and retrieve, up to a maximum of 200. Retweets are always included in the count, so it is always suggested to set $include_rts to true

$trim_user

booleanWhen set to true, each tweet returned in a timeline will include a user object including only the status author's numerical ID.

Response

arrayThe decoded JSON response

getRetweetsOfMe

Method to get the most recent tweets of the authenticated user that have been retweeted by others.

getRetweetsOfMe(integer $count = 20, integer $since_id, boolean $entities = null, boolean $user_entities = null, integer $max_id, boolean $trim_user = null) : array
since

3.1.4

Arguments

$count

integerSpecifies the number of tweets to try and retrieve, up to a maximum of 200. Retweets are always included in the count, so it is always suggested to set $include_rts to true

$since_id

integerReturns results with an ID greater than (that is, more recent than) the specified ID.

$entities

booleanWhen set to true, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags.

$user_entities

booleanThe user entities node will be disincluded when set to false.

$max_id

integerReturns results with an ID less than (that is, older than) the specified ID.

$trim_user

booleanWhen set to true, each tweet returned in a timeline will include a user object including only the status author's numerical ID.

Response

arrayThe decoded JSON response

getTweetById

Method to get a single tweet with the given ID.

getTweetById(integer $id, boolean $trim_user = null, boolean $entities = null, boolean $my_retweet = null) : array
since

3.1.4

Arguments

$id

integerThe ID of the tweet to retrieve.

$trim_user

booleanWhen set to true, each tweet returned in a timeline will include a user object including only the status author's numerical ID.

$entities

booleanWhen set to true, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags.

$my_retweet

booleanWhen set to either true, t or 1, any statuses returned that have been retweeted by the authenticating user will include an additional current_user_retweet node, containing the ID of the source status for the retweet.

Response

arrayThe decoded JSON response

getUserTimeline

Method to retrieve the latest statuses from the specified user timeline.

getUserTimeline(mixed $user, integer $count = 20, boolean $include_rts = null, boolean $no_replies = null, integer $since_id, integer $max_id, boolean $trim_user = null, boolean $contributor = null) : array
since

3.1.4

throws

\RuntimeException

Arguments

$user

mixedEither an integer containing the user ID or a string containing the screen name.

$count

integerSpecifies the number of tweets to try and retrieve, up to a maximum of 200. Retweets are always included in the count, so it is always suggested to set $include_rts to true

$include_rts

booleanWhen set to true, the timeline will contain native retweets in addition to the standard stream of tweets.

$no_replies

booleanThis parameter will prevent replies from appearing in the returned timeline. This parameter is only supported for JSON and XML responses.

$since_id

integerReturns results with an ID greater than (that is, more recent than) the specified ID.

$max_id

integerReturns results with an ID less than (that is, older than) the specified ID.

$trim_user

booleanWhen set to true, each tweet returned in a timeline will include a user object including only the status author's numerical ID.

$contributor

booleanThis parameter enhances the contributors element of the status response to include the screen_name of the contributor. By default only the user_id of the contributor is included.

Response

arrayThe decoded JSON response

retweet

Method to retweet a tweet.

retweet(integer $id, boolean $trim_user = null) : array
since

3.1.4

Arguments

$id

integerThe numerical ID of the desired status.

$trim_user

booleanWhen set to true, each tweet returned in a timeline will include a user object including only the status author's numerical ID.

Response

arrayThe decoded JSON response

sendRequest

Method to send the request.

sendRequest(string $path, string $method = 'GET', mixed $data = array(), array $headers = array()) : array
inherited
since

3.1.4

throws

\RuntimeException

Arguments

$path

stringThe path of the request to make

$method

stringThe request method.

$data

mixedEither an associative array or a string to be sent with the post request.

$headers

arrayAn array of name-value pairs to include in the header of the request

Response

arrayThe decoded JSON response

setOption

Set an option for the JTwitterObject instance.

setOption(string $key, mixed $value) : \JTwitterObject
inherited
since

3.1.4

Arguments

$key

stringThe name of the option to set.

$value

mixedThe option value to set.

Response

\JTwitterObjectThis object for method chaining.

tweet

Method to post a tweet.

tweet(string $status, integer $in_reply_to_status_id = null, float $lat = null, float $long = null, string $place_id = null, boolean $display_coordinates = null, boolean $trim_user = null) : array
since

3.1.4

Arguments

$status

stringThe text of the tweet.

$in_reply_to_status_id

integerThe ID of an existing status that the update is in reply to.

$lat

floatThe latitude of the location this tweet refers to.

$long

floatThe longitude of the location this tweet refers to.

$place_id

stringA place in the world.

$display_coordinates

booleanWhether or not to put a pin on the exact coordinates a tweet has been sent from.

$trim_user

booleanWhen set to true, each tweet returned in a timeline will include a user object including only the status author's numerical ID.

Response

arrayThe decoded JSON response

tweetWithMedia

Method to post a tweet with media.

tweetWithMedia(string $status, string $media, integer $in_reply_to_status_id = null, float $lat = null, float $long = null, string $place_id = null, boolean $display_coordinates = null, boolean $sensitive = null) : array
since

3.1.4

throws

\RuntimeException

Arguments

$status

stringThe text of the tweet.

$media

stringFile to upload

$in_reply_to_status_id

integerThe ID of an existing status that the update is in reply to.

$lat

floatThe latitude of the location this tweet refers to.

$long

floatThe longitude of the location this tweet refers to.

$place_id

stringA place in the world.

$display_coordinates

booleanWhether or not to put a pin on the exact coordinates a tweet has been sent from.

$sensitive

booleanSet to true for content which may not be suitable for every audience.

Response

arrayThe decoded JSON response

Properties

options

Options for the Twitter object.

inherited
since

3.1.4

Type(s)

\Joomla\Registry\Registry

client

The HTTP client object to use in sending HTTP requests.

inherited
since

3.1.4

Type(s)

\JHttp

oauth

The OAuth client.

inherited
since

3.1.4

Type(s)

\JTwitterOAuth