Twitter Lists

Lists are collections of tweets, culled from a curated list of Twitter users. List timeline methods include tweets by all members of a list.

Figure 1a. Instantiate Lists
$lists = eden('twitter')->lists('[TWITTER_KEY]', '[TWITTER_SECRET]', $_SESSION['access_token'], $_SESSION['access_secret']);
Figure 1b. Usage: Get Members of a List
$lists
	->setEntities(false)	//optional
	->skipStatus(false)		//optional
	->setCursor(-1)			//optional
	->getMembers($listId);
Figure 1c. Usage: Get Lists a User Belongs To
$lists
	->setCursor(-1)		//optional
	->getLists($userId, $screenName);
Figure 1d. Usage: Member Check
$lists
	->includeEntities()		//optional
	->skipStatus()			//optional
	->isMember($userId, $listId);
Figure 1e. Usage: Get User's Lists
$lists
	->setCursor(-1)		//optional
	->filterToOwn()		//optional
	->getMemberships($userId);
Figure 1f. Usage: Get List Tweets
$lists
	->setEntities(false)	//optional
	->includeRts()			//optional
	->setSince(12345)		//optional
	->setMax(25)			//optional
	->setPage(1)			//optional
	->getTweets($listId);
Figure 1g. Usage: Get Subscribers of a List
$lists
	->setEntities(false)	//optional
	->skipStatus(false)		//optional
	->setCursor(-1)			//optional
	->getSubscribers($listId);
Figure 1h. Usage: Get Lists You're Subscribed To
$lists
	->setCursor(-1)		//optional
 	->setCount(20)		//optional
	->getSubscriptions($listId);
Figure 1i. Usage: Subscriber Check
$lists
	->includeEntities()		//optional
	->skipStatus()			//optional
	->isSubscriber($userId, $listId);
Figure 1j. Lists Methods
Method Arguments Returns Description
$lists->addMember($userId, $listId, $ownerId = NULL);
  1. int|string
  2. - user ID or screen name
  3. int|string
  4. - list ID or slug
  5. int|string|null
  6. - owner ID or screen name
array Add a member to a list. The authenticated user must own the list to be able to add members to it. Note that lists can't have more than 500 members.
$lists->addMembers($listId, $userIds, $ownerId = NULL);
  1. int|string
  2. - list ID or slug
  3. array
  4. - list of user IDs
  5. int|string
  6. - ownder ID or screen name
array Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names.
$lists->createList($name);
  1. string
  2. - The name for the list.
array Creates a new list for the authenticated user. Note that you can't create more than 20 lists per account.
$lists->getMembers($listId, $ownerId = NULL);
  1. int|string
  2. - list ID or slug
  3. int|string|null
  4. - owner ID or screen name
array Returns the members of the specified list. Private list members will only be shown if the authenticated user owns the specified list.
$lists->getAllLists($id = NULL);
  1. string|null
  2. - The user is specified using the user_id or screen_name parameters. If no user is given, the authenticating user is used.
array Returns all lists the authenticating or specified user subscribes to, including their own.
$lists->getList($listId, $ownerId = NULL);
  1. int|string
  2. - list ID or slug
  3. int|string|null
  4. - owner ID or screen name
array Returns the specified list. Private lists will only be shown if the authenticated user owns the specified list.
$lists->getMemberships($id = NULL);
  1. int|string|null
  2. - user ID or screen name
array Returns the lists the specified user has been added to. If user_id or screen_name are not provided the memberships for the authenticating user are returned.
$lists->getTweets($listId, $ownerId = NULL);
  1. int|string
  2. - list ID or slug
  3. int|string|null
  4. - owner ID or screen name
array Returns tweet timeline for members of the specified list.
$lists->getSubscribers($listId, $ownerId = NULL);
  1. int|string
  2. - list ID or slug
  3. int|string|null
  4. - owner ID or screen name
array Returns the subscribers of the specified list. Private list subscribers will only be shown if the authenticated user owns the specified list.
$lists->getSubscriptions($id);
  1. int|string
  2. - user ID or screen name
array Obtain 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.
$lists->filterToOwn(); none Eden_Twitter_List Will return just lists the authenticating user owns, and the user represented by user_id or screen_name is a member of.
$lists->includeEntities(); none Eden_Twitter_List 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.
$lists->includeRts(); none Eden_Twitter_List The list timeline will contain native retweets (if they exist) in addition to the standard stream of tweets. The output format of retweeted tweets is identical to the representation you see in home_timeline.
$lists->isMember($userId, $listId, $ownerId = NULL);
  1. int|string
  2. - user ID or screen name
  3. int|string
  4. - list ID or slug
  5. int|string|null
  6. - owner ID or screen name
array Check if the specified user is a member of the specified list.
$lists->isSubsciber($userId, $listId, $ownerId = NULL);
  1. int|string
  2. - user ID or screen name
  3. int|string
  4. - list ID or slug
  5. int|string|null
  6. - owner ID or screen name
array Check if the specified user is a subscriber of the specified list. Returns the user if they are subscriber.
$lists->remove($listId, $ownerId = NULL);
  1. int|string
  2. - list ID or slug
  3. int|string|null
  4. - owner ID or screen name
array Deletes the specified list. The authenticated user must own the list to be able to destroy it
$lists->removeMember($userId, $listId, $ownerId = NULL);
  1. int|string
  2. - user ID or screen name
  3. int|string
  4. - list ID or slug
  5. int|string|null
  6. - owner ID or screen name
array Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list.
$lists->setCount($count);
  1. integer
Eden_Twitter_List Sets count
$lists->setCursor($cursor);
  1. string
Eden_Twitter_List Causes the list of connections to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried.
$lists->setMax($max);
  1. integer
Eden_Twitter_List Set max id
$lists->setPage($perPage);
  1. integer
Eden_Twitter_List Sets page
$lists->setSinceId($sinceId);
  1. integer
  2. - the tweet ID
Eden_Twitter_List Set since id
$lists->setDescription($description);
  1. string
Eden_Twitter_List The description to give the list.
$lists->setModeToPrivate(); none Eden_Twitter_List Whether your list is public or private. Values can be public or private. If no mode is specified the list will be public.
$lists->skipStatus(); none Eden_Twitter_List Statuses will not be included in the returned user objects.
$lists->subscribe($listId, $ownerId = NULL);
  1. int|string
  2. - list ID or slug
  3. int|string|null
  4. - owner ID or screen name
array Subscribes the authenticated user to the specified list.
$lists->unsubscribe($listId, $ownerId = NULL);
  1. int|string
  2. - list ID or slug
  3. int|string|null
  4. - owner ID or screen name
array Unsubscribes the authenticated user from the specified list.
$lists->update($listId, $name, $description, $ownerId = NULL, $public = true);
  1. int|string
  2. - list ID or slug
  3. string
  4. string
  5. int|string|null
  6. - owner ID or screen name
  7. bool
array Updates the specified list. The authenticated user must own the list to be able to update it.

© 2012 Openovate Labs. All rights reserved.