class JTwitterUsers extends JTwitterObject

Twitter API Users 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
getUsersLookup( string $screen_name = null, string $id = null, boolean $entities = null)

Method to get up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.

array
getUserProfileBanner( mixed $user)

Method to access the profile banner in various sizes for the user with the indicated screen_name.

array
searchUsers( string $query, integer $page, integer $count, boolean $entities = null)

Method used to search for users

array
getUser( mixed $user, boolean $entities = null)

Method to get extended information of a given user, specified by ID or screen name as per the required id parameter.

array
getContributees( mixed $user, boolean $entities = null, boolean $skip_status = null)

Method to get an array of users that the specified user can contribute to.

array
getContributors( mixed $user, boolean $entities = null, boolean $skip_status = null)

Method to get an array of users who can contribute to the specified account.

array
getSuggestions( boolean $lang = null)

Method access to Twitter's suggested user list.

array
getSuggestionsSlug( string $slug, boolean $lang = null)

method to access the users in a given category of the Twitter suggested user list.

array
getSuggestionsSlugMembers( string $slug)

Method to access the users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected 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.

array getUsersLookup( string $screen_name = null, string $id = null, boolean $entities = null)

Method to get up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.

Parameters

string $screen_name A comma separated list of screen names, up to 100 are allowed in a single request.
string $id A comma separated list of user IDs, up to 100 are allowed in a single request.
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 discreet structure, including: user_mentions, urls, and hashtags.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array getUserProfileBanner( mixed $user)

Method to access the profile banner in various sizes for the user with the indicated screen_name.

Parameters

mixed $user Either an integer containing the user ID or a string containing the screen name.

Return Value

array The decoded JSON response

array searchUsers( string $query, integer $page, integer $count, boolean $entities = null)

Method used to search for users

Parameters

string $query The search query to run against people search.
integer $page Specifies the page of results to retrieve.
integer $count The number of people to retrieve. Maximum of 20 allowed per page.
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 discreet structure, including: user_mentions, urls, and hashtags.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array getUser( mixed $user, boolean $entities = null)

Method to get extended information of a given user, specified by ID or screen name as per the required id parameter.

Parameters

mixed $user Either an integer containing the user ID or a string containing the screen name.
boolean $entities Set to true to return IDs as strings, false to return as integers.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array getContributees( mixed $user, boolean $entities = null, boolean $skip_status = null)

Method to get an array of users that the specified user can contribute to.

Parameters

mixed $user Either an integer containing the user ID or a string containing the screen name.
boolean $entities Set to true to return IDs as strings, false to return as integers.
boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array getContributors( mixed $user, boolean $entities = null, boolean $skip_status = null)

Method to get an array of users who can contribute to the specified account.

Parameters

mixed $user Either an integer containing the user ID or a string containing the screen name.
boolean $entities Set to true to return IDs as strings, false to return as integers.
boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array getSuggestions( boolean $lang = null)

Method access to Twitter's suggested user list.

Parameters

boolean $lang Restricts the suggested categories to the requested language.

Return Value

array The decoded JSON response

array getSuggestionsSlug( string $slug, boolean $lang = null)

method to access the users in a given category of the Twitter suggested user list.

Parameters

string $slug The short name of list or a category.
boolean $lang Restricts the suggested categories to the requested language.

Return Value

array The decoded JSON response

array getSuggestionsSlugMembers( string $slug)

Method to access the users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user.

Parameters

string $slug The short name of list or a category.

Return Value

array The decoded JSON response