JTwitterObject

Twitter API object class for the Joomla Platform.

abstract 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) 
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
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.

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

3.1.4

Arguments

$path

stringURL to inflect

$parameters

arrayThe parameters passed in the URL.

Response

stringThe request URL.

getOption

Get an option from the JTwitterObject instance.

getOption(string $key) : mixed
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
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

sendRequest

Method to send the request.

sendRequest(string $path, string $method = 'GET', mixed $data = array(), array $headers = array()) : array
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
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.

since

3.1.4

Type(s)

\Joomla\Registry\Registry

client

The HTTP client object to use in sending HTTP requests.

since

3.1.4

Type(s)

\JHttp

oauth

The OAuth client.

since

3.1.4

Type(s)

\JTwitterOAuth