class JTwitterLists extends JTwitterObject

Twitter API Lists 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
getLists( mixed $user, boolean $reverse = null)

Method to get all lists the authenticating or specified user subscribes to, including their own.

array
getStatuses( mixed $list, mixed $owner = null, integer $since_id, integer $max_id, integer $count, boolean $entities = null, boolean $include_rts = null)

Method to get tweet timeline for members of the specified list

array
getSubscribers( mixed $list, mixed $owner = null, integer $cursor = null, boolean $entities = null, boolean $skip_status = null)

Method to get the subscribers of the specified list.

array
deleteMembers( mixed $list, string $user_id = null, string $screen_name = null, mixed $owner = null)

Method to remove multiple members from a list, by specifying a comma-separated list of member ids or screen names.

array
subscribe( mixed $list, mixed $owner = null)

Method to subscribe the authenticated user to the specified list.

array
isMember( mixed $list, mixed $user, mixed $owner = null, boolean $entities = null, boolean $skip_status = null)

Method to check if the specified user is a member of the specified list.

array
isSubscriber( mixed $list, mixed $user, mixed $owner = null, boolean $entities = null, boolean $skip_status = null)

Method to check if the specified user is a subscriber of the specified list.

array
unsubscribe( mixed $list, mixed $owner = null)

Method to unsubscribe the authenticated user from the specified list.

array
addMembers( mixed $list, string $user_id = null, string $screen_name = null, mixed $owner = null)

Method to add multiple members to a list, by specifying a comma-separated list of member ids or screen names.

array
getMembers( mixed $list, mixed $owner = null, boolean $entities = null, boolean $skip_status = null)

Method to get the members of the specified list.

array
getListById( mixed $list, mixed $owner = null)

Method to get the specified list.

array
getSubscriptions( mixed $user, integer $count, integer $cursor = null)

Method to get a collection of the lists the specified user is subscribed to, 20 lists per page by default. Does not include the user's own lists.

array
update( mixed $list, mixed $owner = null, string $name = null, string $mode = null, string $description = null)

Method to update the specified list

array
create( string $name, string $mode = null, string $description = null)

Method to create a new list for the authenticated user.

array
delete( mixed $list, mixed $owner = null)

Method to delete a specified list.

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 getLists( mixed $user, boolean $reverse = null)

Method to get all lists the authenticating or specified user subscribes to, including their own.

Parameters

mixed $user Either an integer containing the user ID or a string containing the screen name.
boolean $reverse Set this to true if you would like owned lists to be returned first. See description above for information on how this parameter works.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array getStatuses( mixed $list, mixed $owner = null, integer $since_id, integer $max_id, integer $count, boolean $entities = null, boolean $include_rts = null)

Method to get tweet timeline for members of the specified list

Parameters

mixed $list Either an integer containing the list ID or a string containing the list slug.
mixed $owner Either an integer containing the user ID or a string containing the screen name.
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.
integer $count Specifies the number of results to retrieve 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.
boolean $include_rts When set to either true, t or 1, the list timeline will contain native retweets (if they exist) in addition to the standard stream of tweets.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array getSubscribers( mixed $list, mixed $owner = null, integer $cursor = null, boolean $entities = null, boolean $skip_status = null)

Method to get the subscribers of the specified list.

Parameters

mixed $list Either an integer containing the list ID or a string containing the list slug.
mixed $owner Either an integer containing the user ID or a string containing the screen name.
integer $cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging.
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.
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 deleteMembers( mixed $list, string $user_id = null, string $screen_name = null, mixed $owner = null)

Method to remove multiple members from a list, by specifying a comma-separated list of member ids or screen names.

Parameters

mixed $list Either an integer containing the list ID or a string containing the list slug.
string $user_id A comma separated list of user IDs, up to 100 are allowed in a single request.
string $screen_name A comma separated list of screen names, up to 100 are allowed in a single request.
mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array subscribe( mixed $list, mixed $owner = null)

Method to subscribe the authenticated user to the specified list.

Parameters

mixed $list Either an integer containing the list ID or a string containing the list slug.
mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array isMember( mixed $list, mixed $user, mixed $owner = null, boolean $entities = null, boolean $skip_status = null)

Method to check if the specified user is a member of the specified list.

Parameters

mixed $list Either an integer containing the list ID or a string containing the list slug.
mixed $user Either an integer containing the user ID or a string containing the screen name of the user to remove.
mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner.
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.
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 isSubscriber( mixed $list, mixed $user, mixed $owner = null, boolean $entities = null, boolean $skip_status = null)

Method to check if the specified user is a subscriber of the specified list.

Parameters

mixed $list Either an integer containing the list ID or a string containing the list slug.
mixed $user Either an integer containing the user ID or a string containing the screen name of the user to remove.
mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner.
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.
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 unsubscribe( mixed $list, mixed $owner = null)

Method to unsubscribe the authenticated user from the specified list.

Parameters

mixed $list Either an integer containing the list ID or a string containing the list slug.
mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array addMembers( mixed $list, string $user_id = null, string $screen_name = null, mixed $owner = null)

Method to add multiple members to a list, by specifying a comma-separated list of member ids or screen names.

Parameters

mixed $list Either an integer containing the list ID or a string containing the list slug.
string $user_id A comma separated list of user IDs, up to 100 are allowed in a single request.
string $screen_name A comma separated list of screen names, up to 100 are allowed in a single request.
mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array getMembers( mixed $list, mixed $owner = null, boolean $entities = null, boolean $skip_status = null)

Method to get the members of the specified list.

Parameters

mixed $list Either an integer containing the list ID or a string containing the list slug.
mixed $owner Either an integer containing the user ID or a string containing the screen name.
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.
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 getListById( mixed $list, mixed $owner = null)

Method to get the specified list.

Parameters

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

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array getSubscriptions( mixed $user, integer $count, integer $cursor = null)

Method to get a collection of the lists the specified user is subscribed to, 20 lists per page by default. Does not include the user's own lists.

Parameters

mixed $user Either an integer containing the user ID or a string containing the screen name.
integer $count The amount of results to return per page. Defaults to 20. Maximum of 1,000 when using cursors.
integer $cursor Breaks the results into pages. Provide a value of -1 to begin paging.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array update( mixed $list, mixed $owner = null, string $name = null, string $mode = null, string $description = null)

Method to update the specified list

Parameters

mixed $list Either an integer containing the list ID or a string containing the list slug.
mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner.
string $name The name of the list.
string $mode Whether your list is public or private. Values can be public or private. If no mode is specified the list will be public.
string $description The description to give the list.

Return Value

array The decoded JSON response

Exceptions

RuntimeException

array create( string $name, string $mode = null, string $description = null)

Method to create a new list for the authenticated user.

Parameters

string $name The name of the list.
string $mode Whether your list is public or private. Values can be public or private. If no mode is specified the list will be public.
string $description The description to give the list.

Return Value

array The decoded JSON response

array delete( mixed $list, mixed $owner = null)

Method to delete a specified list.

Parameters

mixed $list Either an integer containing the list ID or a string containing the list slug.
mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner.

Return Value

array The decoded JSON response

Exceptions

RuntimeException