JTwitterDirectmessages

Extends \JTwitterObject

Twitter API Direct Messages 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.

deleteDirectMessages

Method to delete the direct message specified in the required ID parameter.

deleteDirectMessages(integer $id, boolean $entities = null) : array
since

3.1.4

Arguments

$id

integerThe ID of the direct message.

$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.

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.

getDirectMessages

Method to get the most recent direct messages sent to the authenticating user.

getDirectMessages(integer $since_id, integer $max_id, integer $count = 20, boolean $entities = null, boolean $skip_status = null) : array
since

3.1.4

Arguments

$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) or equal to the specified ID.

$count

integerSpecifies the number of direct messages to try and retrieve, up to a maximum of 200.

$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.

$skip_status

booleanWhen set to either true, t or 1 statuses will not be included in the returned user objects.

Response

arrayThe decoded JSON response

getDirectMessagesById

Method to get a single direct message, specified by an id parameter.

getDirectMessagesById(integer $id) : array
since

3.1.4

Arguments

$id

integerThe ID of the direct message.

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

getSentDirectMessages

Method to get the most recent direct messages sent by the authenticating user.

getSentDirectMessages(integer $since_id, integer $max_id, integer $count = 20, integer $page, boolean $entities = null) : array
since

3.1.4

Arguments

$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) or equal to the specified ID.

$count

integerSpecifies the number of direct messages to try and retrieve, up to a maximum of 200.

$page

integerSpecifies the page of results to retrieve.

$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.

Response

arrayThe decoded JSON response

sendDirectMessages

Method to send a new direct message to the specified user from the authenticating user.

sendDirectMessages(mixed $user, string $text) : array
since

3.1.4

throws

\RuntimeException

Arguments

$user

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

$text

stringThe text of your direct message. Be sure to keep the message under 140 characters.

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.

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