JTwitterPlaces
Extends \JTwitterObjectTwitter API Places & Geo 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.
createPlace
Method to create a new place object at the given latitude and longitude.
createPlace(float $lat, float $long, string $name, string $geoToken, string $within, string $attribute = null, string $callback = null) : array
since |
3.1.4 |
---|
Arguments
- $lat
float
The latitude to search around.- $long
float
The longitude to search around.- $name
string
The name a place is known as.- $geoToken
string
The token found in the response from geo/similar_places.- $within
string
This is the place_id which you would like to restrict the search results to.- $attribute
string
This parameter searches for places which have this given street address.- $callback
string
If supplied, the response will use the JSONP format with a callback of the given name.
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.
getGeocode
Method to get up to 20 places that can be used as a place_id when updating a status.
getGeocode(float $lat, float $long, string $accuracy = null, string $granularity = null, integer $maxResults, string $callback = null) : array
since |
3.1.4 |
---|
Arguments
- $lat
float
The latitude to search around.- $long
float
The longitude to search around.- $accuracy
string
A hint on the "region" in which to search. If a number, then this is a radius in meters, but it can also take a string that is suffixed with ft to specify feet.- $granularity
string
This is the minimal granularity of place types to return and must be one of: poi, neighborhood, city, admin or country.- $maxResults
integer
A hint as to the number of results to return.- $callback
string
If supplied, the response will use the JSONP format with a callback of the given name.
Response
array
The decoded JSON response
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.
getPlace
Method to get all the information about a known place.
getPlace(string $id) : array
since |
3.1.4 |
---|
Arguments
- $id
string
A place in the world. These IDs can be retrieved using getGeocode.
Response
array
The decoded JSON response
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
getSimilarPlaces
Method to locate places near the given coordinates which are similar in name.
getSimilarPlaces(float $lat, float $long, string $name, string $within = null, string $attribute = null, string $callback = null) : array
since |
3.1.4 |
---|
Arguments
- $lat
float
The latitude to search around.- $long
float
The longitude to search around.- $name
string
The name a place is known as.- $within
string
This is the place_id which you would like to restrict the search results to.- $attribute
string
This parameter searches for places which have this given street address.- $callback
string
If supplied, the response will use the JSONP format with a callback of the given name.
Response
array
The decoded JSON response
search
Method to search for places that can be attached to a statuses/update.
search(float $lat = null, float $long = null, string $query = null, string $ip = null, string $granularity = null, string $accuracy = null, integer $maxResults, string $within = null, string $attribute = null, string $callback = null) : array
since |
3.1.4 |
---|---|
throws |
|
Arguments
- $lat
float
The latitude to search around.- $long
float
The longitude to search around.- $query
string
Free-form text to match against while executing a geo-based query, best suited for finding nearby locations by name.- $ip
string
An IP address.- $granularity
string
This is the minimal granularity of place types to return and must be one of: poi, neighborhood, city, admin or country.- $accuracy
string
A hint on the "region" in which to search. If a number, then this is a radius in meters, but it can also take a string that is suffixed with ft to specify feet.- $maxResults
integer
A hint as to the number of results to return.- $within
string
This is the place_id which you would like to restrict the search results to.- $attribute
string
This parameter searches for places which have this given street address.- $callback
string
If supplied, the response will use the JSONP format with a callback of the given name.
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