Example usage for twitter4j Twitter getUserListMemberships

List of usage examples for twitter4j Twitter getUserListMemberships

Introduction

In this page you can find the example usage for twitter4j Twitter getUserListMemberships.

Prototype

PagableResponseList<UserList> getUserListMemberships(int count, long cursor) throws TwitterException;

Source Link

Document

List the lists the authenticating user has been added to.

Usage

From source file:de.vanita5.twittnuker.loader.support.UserListMembershipsLoader.java

License:Open Source License

@Override
public PagableResponseList<UserList> getUserLists(final Twitter twitter) throws TwitterException {
    if (twitter == null)
        return null;
    if (mUserId > 0)
        return twitter.getUserListMemberships(mUserId, getCursor());
    else if (mScreenName != null)
        return twitter.getUserListMemberships(mScreenName, getCursor());
    return null;//from w  w w .j a  va  2 s  .  c o m
}

From source file:org.getlantern.firetweet.loader.support.UserListMembershipsLoader.java

License:Open Source License

@Override
public PageableResponseList<UserList> getUserLists(final Twitter twitter) throws TwitterException {
    if (twitter == null)
        return null;
    if (mUserId > 0)
        return twitter.getUserListMemberships(mUserId, getCursor());
    else if (mScreenName != null)
        return twitter.getUserListMemberships(mScreenName, getCursor());
    return null;/*from ww w .  j a v  a  2s.com*/
}

From source file:twitter4j.examples.list.GetUserListMemberships.java

License:Apache License

/**
 * Usage: java twitter4j.examples.list.GetUserListMemberships [list member screen name]
 *
 * @param args message/*from  w w  w.  j a  v  a 2 s.c o  m*/
 */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println(
                "Usage: java twitter4j.examples.list.GetUserListMemberships [list member screen name]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        long cursor = -1;
        PagableResponseList<UserList> lists;
        do {
            lists = twitter.getUserListMemberships(args[0], cursor);
            for (UserList list : lists) {
                System.out.println("id:" + list.getId() + ", name:" + list.getName() + ", description:"
                        + list.getDescription() + ", slug:" + list.getSlug() + "");
            }
        } while ((cursor = lists.getNextCursor()) != 0);
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to list the lists: " + te.getMessage());
        System.exit(-1);
    }
}