class JTwittersearch extends JTwitterObject

Twitter API Search class for the Joomla Platform.

Methods

__construct( Registry $options = null, JHttp $client = null, JTwitterOAuth $oauth = null)

Constructor.

void
checkRateLimit( string $resource = null, string $action = null)

Method to check the rate limit for the requesting IP address

string
fetchUrl( string $path, array $parameters = null)

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.

array
getRateLimit( string $resource)

Method to retrieve the rate limit for the requesting IP address

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

Method to send the request.

mixed
getOption( string $key)

Get an option from the JTwitterObject instance.

setOption( string $key, mixed $value)

Set an option for the JTwitterObject instance.

array
search( string $query, string $callback = null, string $geocode = null, string $lang = null, string $locale = null, string $result_type = null, integer $count = 15, string $until = null, integer $since_id, integer $max_id, boolean $entities = null)

Method to get tweets that match a specified query.

array
getSavedSearches()

Method to get the authenticated user's saved search queries.

array
getSavedSearchesById( integer $id)

Method to get the information for the saved search represented by the given id.

array
createSavedSearch( string $query)

Method to create a new saved search for the authenticated user.

array
deleteSavedSearch( integer $id)

Method to delete a saved search for the authenticating user.

Details

__construct( Registry $options = null, JHttp $client = null, JTwitterOAuth $oauth = null)

Constructor.

Parameters

Registry $options &$options Twitter options object.
JHttp $client The HTTP client object.
JTwitterOAuth $oauth The OAuth client.

void checkRateLimit( string $resource = null, string $action = null)

Method to check the rate limit for the requesting IP address

Parameters

string $resource A resource or a comma-separated list of resource families you want to know the current rate limit disposition for.
string $action An action for the specified resource, if only one resource is specified.

Return Value

void

Exceptions

RuntimeException

string fetchUrl( string $path, array $parameters = null)

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.

Parameters

string $path URL to inflect
array $parameters The parameters passed in the URL.

Return Value

string The request URL.

array getRateLimit( string $resource)

Method to retrieve the rate limit for the requesting IP address

Parameters

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

Return Value

array The JSON response decoded

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

Method to send the request.

Parameters

string $path The path of the request to make
string $method The request method.
mixed $data Either an associative array or a string to be sent with the post request.
array $headers An array of name-value pairs to include in the header of the request

Return Value

array The decoded JSON response

Exceptions

RuntimeException

mixed getOption( string $key)

Get an option from the JTwitterObject instance.

Parameters

string $key The name of the option to get.

Return Value

mixed The option value.

JTwitterObject setOption( string $key, mixed $value)

Set an option for the JTwitterObject instance.

Parameters

string $key The name of the option to set.
mixed $value The option value to set.

Return Value

JTwitterObject This object for method chaining.

Method to get tweets that match a specified query.

Parameters

string $query Search query. Should be URL encoded. Queries will be limited by complexity.
string $callback If supplied, the response will use the JSONP format with a callback of the given name
string $geocode Returns tweets by users located within a given radius of the given latitude/longitude. The parameter value is specified by "latitude,longitude,radius", where radius units must be specified as either "mi" (miles) or "km" (kilometers).
string $lang Restricts tweets to the given language, given by an ISO 639-1 code.
string $locale Specify the language of the query you are sending (only ja is currently effective). This is intended for language-specific clients and the default should work in the majority of cases.
string $result_type Specifies what type of search results you would prefer to receive. The current default is "mixed."
integer $count The number of tweets to return per page, up to a maximum of 100. Defaults to 15.
string $until Returns tweets generated before the given date. Date should be formatted as YYYY-MM-DD.
integer $since_id Returns results with an ID greater than (that is, more recent than) the specified ID.
integer $max_id Returns results with an ID less than (that is, older than) or equal to the specified ID.
boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discrete structure, including: urls, media and hashtags.

Return Value

array The decoded JSON response

array getSavedSearches()

Method to get the authenticated user's saved search queries.

Return Value

array The decoded JSON response

array getSavedSearchesById( integer $id)

Method to get the information for the saved search represented by the given id.

Parameters

integer $id The ID of the saved search.

Return Value

array The decoded JSON response

array createSavedSearch( string $query)

Method to create a new saved search for the authenticated user.

Parameters

string $query The query of the search the user would like to save.

Return Value

array The decoded JSON response

array deleteSavedSearch( integer $id)

Method to delete a saved search for the authenticating user.

Parameters

integer $id The ID of the saved search.

Return Value

array The decoded JSON response