JTwittersearch
Extends \JTwitterObjectTwitter API Search class for the Joomla Platform.
since |
3.1.4 |
---|---|
deprecated |
4.0 Use the |
package |
Joomla.Platform |
Methods
__construct
Constructor.
__construct(\Joomla\Registry\Registry &$options = null, \JHttp $client = null, \JTwitterOAuth $oauth = null)
since |
3.1.4 |
---|
Arguments
- $options
- $client
\JHttp
The HTTP client object.- $oauth
\JTwitterOAuth
The 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 |
|
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.
createSavedSearch
Method to create a new saved search for the authenticated user.
createSavedSearch(string $query) : array
since |
3.1.4 |
---|
Arguments
- $query
string
The query of the search the user would like to save.
Response
array
The decoded JSON response
deleteSavedSearch
Method to delete a saved search for the authenticating user.
deleteSavedSearch(integer $id) : array
since |
3.1.4 |
---|
Arguments
- $id
integer
The ID of the saved search.
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 |
3.1.4 |
---|
Arguments
- $path
string
URL to inflect- $parameters
array
The parameters passed in the URL.
Response
string
The request URL.
getOption
Get an option from the JTwitterObject instance.
getOption(string $key) : mixed
since |
3.1.4 |
---|
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 |
3.1.4 |
---|
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
getSavedSearches
Method to get the authenticated user's saved search queries.
getSavedSearches() : array
since |
3.1.4 |
---|
Response
array
The decoded JSON response
getSavedSearchesById
Method to get the information for the saved search represented by the given id.
getSavedSearchesById(integer $id) : array
since |
3.1.4 |
---|
Arguments
- $id
integer
The ID of the saved search.
Response
array
The decoded JSON response
search
Method to get tweets that match a specified query.
search(string $query, string $callback = null, string $geocode = null, string $lang = null, string $locale = null, string $resultType = null, integer $count = 15, string $until = null, integer $sinceId, integer $maxId, boolean $entities = null) : array
since |
3.1.4 |
---|
Arguments
- $query
string
Search query. Should be URL encoded. Queries will be limited by complexity.- $callback
string
If supplied, the response will use the JSONP format with a callback of the given name- $geocode
string
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).- $lang
string
Restricts tweets to the given language, given by an ISO 639-1 code.- $locale
string
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.- $resultType
string
Specifies what type of search results you would prefer to receive. The current default is "mixed."- $count
integer
The number of tweets to return per page, up to a maximum of 100. Defaults to 15.- $until
string
Returns tweets generated before the given date. Date should be formatted as YYYY-MM-DD.- $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.- $entities
boolean
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.
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 |
3.1.4 |
---|---|
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 JTwitterObject instance.
setOption(string $key, mixed $value) : \JTwitterObject
since |
3.1.4 |
---|
Arguments
- $key
string
The name of the option to set.- $value
mixed
The option value to set.
Response
\JTwitterObject
This object for method chaining.
Properties
client
The HTTP client object to use in sending HTTP requests.
since |
3.1.4 |
---|
Type(s)
\JHttp