Skip to content

Twitter Lists : Subscribers

linvi edited this page Mar 13, 2016 · 13 revisions

Overview

Users can follow other user's Twitter Lists if their privacy mode is set to Public.

Let's code!

Get User Subscriptions

// User instance
var lists = user.GetListsSubscriptions(<maximumNumberOfListsToRetrieve>);

// Static TwitterList
var lists = TwitterList.GetUserListSubscriptions(<user_identifier>, <maximumNumberOfListsToRetrieve>);

Check List Subscriptions

You can check if a user has subscribed to a List

// List instance
var isSubscribed = list.CheckUserSubscription(<user_identifier>);

// Static TwitterList
var isSubscribed = TwitterList.CheckIfUserIsAListMember(<list_identifier>, <user_identifier>);

Subscribe Authenticated User to List

To subscribe to a List, a user needs to be authenticatedUserd in. As a result, only AuthenticatedUsers can subscribe to a List.

// AuthenticatedUser instance
var success = authenticatedUserdUser.SubsribeToList(list);

// Twitter List instance : Using the currently authenticatedUserd in user
var success = list.SubscribeAuthenticatedUserToList();

// Twitter List instance : Using the AuthenticatedUser parameter
var success = list.SubscribeAuthenticatedUserToList(<authenticatedUserdUser>);

// Static TwitterList: Using the currently authenticatedUserd in user
var success = TwitterList.SubsribeToList(list);

// Static TwitterList: Using the AuthenticatedUser parameter
var success = TwitterList.SubsribeToList(list, <authenticatedUserdUser>);

UnSubscribe Authenticated User from List

This is the exact same concept as the subscribe operations.

// AuthenticatedUser instance
var success = lu.UnSubscribeFromList(list);

// Twitter List instance : Using the currently authenticatedUserd in user
var success = list.UnSubscribeAuthenticatedUserFromList();

// Twitter List instance : Using the AuthenticatedUser parameter
var success = list.UnSubscribeAuthenticatedUserFromList(<authenticatedUserdUser>);

// Static TwitterList: Using the currently authenticatedUserd in user
var success = TwitterList.UnSubscribeAuthenticatedUserFromList(list);

// Static TwitterList: Using the AuthenticatedUser parameter
var success = TwitterList.UnSubscribeAuthenticatedUserFromList(list, <authenticatedUserdUser>);
Clone this wiki locally