JTwitterLists

Extends \JTwitterObject

Twitter API Lists class for the Joomla Platform.

deprecated
since

3.1.4

deprecated

4.0 Use the joomla/twitter package via Composer instead

package

Joomla.Platform

Methods

__construct

Constructor.

__construct(\Joomla\Registry\Registry &$options = null, \JHttp $client = null, \JTwitterOAuth $oauth = null) 
inherited
since

3.1.4

Arguments

$options

\Joomla\Registry\Registry

$client

\JHttpThe HTTP client object.

$oauth

\JTwitterOAuthThe OAuth client.

addMembers

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

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

3.1.4

throws

\RuntimeException

Arguments

$list

mixedEither an integer containing the list ID or a string containing the list slug.

$user_id

stringA comma separated list of user IDs, up to 100 are allowed in a single request.

$screen_name

stringA comma separated list of screen names, up to 100 are allowed in a single request.

$owner

mixedEither an integer containing the user ID or a string containing the screen name of the owner.

Response

arrayThe decoded JSON response

checkRateLimit

Method to check the rate limit for the requesting IP address

checkRateLimit(string $resource = null, string $action = null) : void
inherited
since

3.1.4

throws

\RuntimeException

Arguments

$resource

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

$action

stringAn action for the specified resource, if only one resource is specified.

create

Method to create a new list for the authenticated user.

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

3.1.4

Arguments

$name

stringThe name of the list.

$mode

stringWhether your list is public or private. Values can be public or private. If no mode is specified the list will be public.

$description

stringThe description to give the list.

Response

arrayThe decoded JSON response

delete

Method to delete a specified list.

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

3.1.4

throws

\RuntimeException

Arguments

$list

mixedEither an integer containing the list ID or a string containing the list slug.

$owner

mixedEither an integer containing the user ID or a string containing the screen name of the owner.

Response

arrayThe decoded JSON response

deleteMembers

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

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

3.1.4

throws

\RuntimeException

Arguments

$list

mixedEither an integer containing the list ID or a string containing the list slug.

$user_id

stringA comma separated list of user IDs, up to 100 are allowed in a single request.

$screen_name

stringA comma separated list of screen names, up to 100 are allowed in a single request.

$owner

mixedEither an integer containing the user ID or a string containing the screen name of the owner.

Response

arrayThe 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
inherited
since

3.1.4

Arguments

$path

stringURL to inflect

$parameters

arrayThe parameters passed in the URL.

Response

stringThe request URL.

getListById

Method to get the specified list.

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

3.1.4

throws

\RuntimeException

Arguments

$list

mixedEither an integer containing the list ID or a string containing the list slug.

$owner

mixedEither an integer containing the user ID or a string containing the screen name.

Response

arrayThe decoded JSON response

getLists

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

getLists(mixed $user, boolean $reverse = null) : array
since

3.1.4

throws

\RuntimeException

Arguments

$user

mixedEither an integer containing the user ID or a string containing the screen name.

$reverse

booleanSet this to true if you would like owned lists to be returned first. See description above for information on how this parameter works.

Response

arrayThe decoded JSON response

getMembers

Method to get the members of the specified list.

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

3.1.4

throws

\RuntimeException

Arguments

$list

mixedEither an integer containing the list ID or a string containing the list slug.

$owner

mixedEither an integer containing the user ID or a string containing the screen name.

$entities

booleanWhen 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.

$skip_status

booleanWhen set to either true, t or 1 statuses will not be included in the returned user objects.

Response

arrayThe decoded JSON response

getOption

Get an option from the JTwitterObject instance.

getOption(string $key) : mixed
inherited
since

3.1.4

Arguments

$key

stringThe name of the option to get.

Response

mixedThe option value.

getRateLimit

Method to retrieve the rate limit for the requesting IP address

getRateLimit(string $resource) : array
inherited
since

3.1.4

Arguments

$resource

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

Response

arrayThe JSON response decoded

getStatuses

Method to get tweet timeline for members of the specified list

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

3.1.4

throws

\RuntimeException

Arguments

$list

mixedEither an integer containing the list ID or a string containing the list slug.

$owner

mixedEither an integer containing the user ID or a string containing the screen name.

$since_id

integerReturns results with an ID greater than (that is, more recent than) the specified ID.

$max_id

integerReturns results with an ID less than (that is, older than) or equal to the specified ID.

$count

integerSpecifies the number of results to retrieve per "page."

$entities

booleanWhen 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.

$include_rts

booleanWhen 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.

Response

arrayThe decoded JSON response

getSubscribers

Method to get the subscribers of the specified list.

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

3.1.4

throws

\RuntimeException

Arguments

$list

mixedEither an integer containing the list ID or a string containing the list slug.

$owner

mixedEither an integer containing the user ID or a string containing the screen name.

$cursor

integerBreaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging.

$entities

booleanWhen 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.

$skip_status

booleanWhen set to either true, t or 1 statuses will not be included in the returned user objects.

Response

arrayThe decoded JSON response

getSubscriptions

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.

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

3.1.4

throws

\RuntimeException

Arguments

$user

mixedEither an integer containing the user ID or a string containing the screen name.

$count

integerThe amount of results to return per page. Defaults to 20. Maximum of 1,000 when using cursors.

$cursor

integerBreaks the results into pages. Provide a value of -1 to begin paging.

Response

arrayThe decoded JSON response

isMember

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

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

3.1.4

throws

\RuntimeException

Arguments

$list

mixedEither an integer containing the list ID or a string containing the list slug.

$user

mixedEither an integer containing the user ID or a string containing the screen name of the user to remove.

$owner

mixedEither an integer containing the user ID or a string containing the screen name of the owner.

$entities

booleanWhen 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.

$skip_status

booleanWhen set to either true, t or 1 statuses will not be included in the returned user objects.

Response

arrayThe decoded JSON response

isSubscriber

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

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

3.1.4

throws

\RuntimeException

Arguments

$list

mixedEither an integer containing the list ID or a string containing the list slug.

$user

mixedEither an integer containing the user ID or a string containing the screen name of the user to remove.

$owner

mixedEither an integer containing the user ID or a string containing the screen name of the owner.

$entities

booleanWhen 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.

$skip_status

booleanWhen set to either true, t or 1 statuses will not be included in the returned user objects.

Response

arrayThe decoded JSON response

sendRequest

Method to send the request.

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

3.1.4

throws

\RuntimeException

Arguments

$path

stringThe path of the request to make

$method

stringThe request method.

$data

mixedEither an associative array or a string to be sent with the post request.

$headers

arrayAn array of name-value pairs to include in the header of the request

Response

arrayThe decoded JSON response

setOption

Set an option for the JTwitterObject instance.

setOption(string $key, mixed $value) : \JTwitterObject
inherited
since

3.1.4

Arguments

$key

stringThe name of the option to set.

$value

mixedThe option value to set.

Response

\JTwitterObjectThis object for method chaining.

subscribe

Method to subscribe the authenticated user to the specified list.

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

3.1.4

throws

\RuntimeException

Arguments

$list

mixedEither an integer containing the list ID or a string containing the list slug.

$owner

mixedEither an integer containing the user ID or a string containing the screen name of the owner.

Response

arrayThe decoded JSON response

unsubscribe

Method to unsubscribe the authenticated user from the specified list.

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

3.1.4

throws

\RuntimeException

Arguments

$list

mixedEither an integer containing the list ID or a string containing the list slug.

$owner

mixedEither an integer containing the user ID or a string containing the screen name of the owner.

Response

arrayThe decoded JSON response

update

Method to update the specified list

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

3.1.4

throws

\RuntimeException

Arguments

$list

mixedEither an integer containing the list ID or a string containing the list slug.

$owner

mixedEither an integer containing the user ID or a string containing the screen name of the owner.

$name

stringThe name of the list.

$mode

stringWhether your list is public or private. Values can be public or private. If no mode is specified the list will be public.

$description

stringThe description to give the list.

Response

arrayThe decoded JSON response

Properties

options

Options for the Twitter object.

inherited
since

3.1.4

Type(s)

\Joomla\Registry\Registry

client

The HTTP client object to use in sending HTTP requests.

inherited
since

3.1.4

Type(s)

\JHttp

oauth

The OAuth client.

inherited
since

3.1.4

Type(s)

\JTwitterOAuth