Lists

Extends \Joomla\Twitter\Object

Twitter API Lists class for the Joomla Framework.

deprecated
since

1.0

deprecated

The joomla/twitter package is deprecated

Methods

__construct

Constructor.

__construct(array &$options, \Joomla\Http\Http $client, \Joomla\Twitter\OAuth $oauth) 
inherited
since

Arguments

$options

arrayTwitter options array.

$client

\Joomla\Http\HttpThe HTTP client object.

$oauth

\Joomla\Twitter\OAuthThe 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 $userId = null, string $screenName = null, mixed $owner = null) : array
since

1.0

throws

\RuntimeException

Arguments

$list

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

$userId

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

$screenName

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

1.0

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

1.0

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

deleteMember

Method to remove individual members from a list.

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

1.2.0

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.

$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 $userId = null, string $screenName = null, mixed $owner = null) : array
since

1.0

throws

\RuntimeException

Arguments

$list

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

$userId

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

$screenName

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

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

1.0

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

1.0

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 $skipStatus = null) : array
since

1.0

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.

$skipStatus

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

Response

arrayThe decoded JSON response

getMemberships

Method to get the lists the specified user has been added to.

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

1.2.0

throws

\RuntimeException

Arguments

$user

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

$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

getOption

Get an option from the Twitter Object instance.

getOption(string $key) : mixed
inherited
since

Arguments

$key

stringThe name of the option to get.

Response

mixedThe option value.

getOwnerships

Method to get a collection of the lists the specified user owns. Private lists will only show if authenticated user is owner.

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

1.2.0

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

getRateLimit

Method to retrieve the rate limit for the requesting IP address

getRateLimit(string $resource) : array
inherited
since

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 $sinceId, integer $maxId, integer $count, boolean $entities = null, boolean $includeRts = null) : array
since

1.0

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.

$sinceId

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

$maxId

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.

$includeRts

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 $skipStatus = null) : array
since

1.0

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.

$skipStatus

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. Does not include the user's own lists.

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

1.0

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 $skipStatus = null) : array
since

1.0

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.

$skipStatus

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 $skipStatus = null) : array
since

1.0

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.

$skipStatus

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
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 Twitter Object instance.

setOption(string $key, mixed $value) : \Joomla\Twitter\AbstractTwitterObject
inherited
since

Arguments

$key

stringThe name of the option to set.

$value

mixedThe option value to set.

Response

\Joomla\Twitter\AbstractTwitterObjectThis object for method chaining.

subscribe

Method to subscribe the authenticated user to the specified list.

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

1.0

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

1.0

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

1.0

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

Type(s)

array

client

The HTTP client object to use in sending HTTP requests.

inherited
since

Type(s)

\Joomla\Http\Http

oauth

The OAuth client.

inherited
since

Type(s)

\Joomla\Twitter\OAuth