Directmessages
Extends \Joomla\Twitter\ObjectTwitter API Direct Messages class for the Joomla Framework.
since |
1.0 |
---|---|
deprecated |
The joomla/twitter package is deprecated |
Methods
__construct
Constructor.
__construct(array &$options, \Joomla\Http\Http $client, \Joomla\Twitter\OAuth $oauth)
since |
---|
Arguments
- $options
array
Twitter options array.- $client
\Joomla\Http\Http
The HTTP client object.- $oauth
\Joomla\Twitter\OAuth
The OAuth client.
checkRateLimit
Method to check the rate limit for the requesting IP address
checkRateLimit(string $resource = null, string $action = null) : void
since | |
---|---|
throws |
|
Arguments
- $resource
string
A resource or a comma-separated list of resource families you want to know the current rate limit disposition for.- $action
string
An 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 |
1.0 |
---|
Arguments
- $id
integer
The ID of the direct message.- $entities
boolean
When 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
array
The 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
since |
---|
Arguments
- $path
string
URL to inflect- $parameters
array
The parameters passed in the URL.
Response
string
The request URL.
getDirectMessages
Method to get the most recent direct messages sent to the authenticating user.
getDirectMessages(integer $sinceId, integer $maxId, integer $count = 20, boolean $entities = null, boolean $skipStatus = null) : array
since |
1.0 |
---|
Arguments
- $sinceId
integer
Returns results with an ID greater than (that is, more recent than) the specified ID.- $maxId
integer
Returns results with an ID less than (that is, older than) or equal to the specified ID.- $count
integer
Specifies the number of direct messages to try and retrieve, up to a maximum of 200.- $entities
boolean
When 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.- $skipStatus
boolean
When set to either true, t or 1 statuses will not be included in the returned user objects.
Response
array
The decoded JSON response
getDirectMessagesById
Method to get a single direct message, specified by an id parameter.
getDirectMessagesById(integer $id) : array
since |
1.0 |
---|
Arguments
- $id
integer
The ID of the direct message.
Response
array
The decoded JSON response
getOption
Get an option from the Twitter Object instance.
getOption(string $key) : mixed
since |
---|
Arguments
- $key
string
The name of the option to get.
Response
mixed
The option value.
getRateLimit
Method to retrieve the rate limit for the requesting IP address
getRateLimit(string $resource) : array
since |
---|
Arguments
- $resource
string
A resource or a comma-separated list of resource families you want to know the current rate limit disposition for.
Response
array
The JSON response decoded
getSentDirectMessages
Method to get the most recent direct messages sent by the authenticating user.
getSentDirectMessages(integer $sinceId, integer $maxId, integer $count = 20, integer $page, boolean $entities = null) : array
since |
1.0 |
---|
Arguments
- $sinceId
integer
Returns results with an ID greater than (that is, more recent than) the specified ID.- $maxId
integer
Returns results with an ID less than (that is, older than) or equal to the specified ID.- $count
integer
Specifies the number of direct messages to try and retrieve, up to a maximum of 200.- $page
integer
Specifies the page of results to retrieve.- $entities
boolean
When 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
array
The 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 |
1.0 |
---|---|
throws |
|
Arguments
- $user
mixed
Either an integer containing the user ID or a string containing the screen name.- $text
string
The text of your direct message. Be sure to keep the message under 140 characters.
Response
array
The decoded JSON response
sendRequest
Method to send the request.
sendRequest(string $path, string $method = 'GET', mixed $data = array(), array $headers = array()) : array
since | |
---|---|
throws |
|
Arguments
- $path
string
The path of the request to make- $method
string
The request method.- $data
mixed
Either an associative array or a string to be sent with the post request.- $headers
array
An array of name-value pairs to include in the header of the request
Response
array
The decoded JSON response
setOption
Set an option for the Twitter Object instance.
setOption(string $key, mixed $value) : \Joomla\Twitter\AbstractTwitterObject
since |
---|
Arguments
- $key
string
The name of the option to set.- $value
mixed
The option value to set.
Response
\Joomla\Twitter\AbstractTwitterObject
This object for method chaining.
Properties
options
Options for the Twitter object.
since |
---|
Type(s)
array
client
The HTTP client object to use in sending HTTP requests.