Example usage for twitter4j Twitter getUserListSubscriptions

List of usage examples for twitter4j Twitter getUserListSubscriptions

Introduction

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

Prototype

PagableResponseList<UserList> getUserListSubscriptions(String listSubscriberScreenName, long cursor)
        throws TwitterException;

Source Link

Document

List the lists the specified user follows.

Usage

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

License:Apache License

/**
 * Usage: java twitter4j.examples.list.GetUserListSubscriptions [screen name]
 *
 * @param args message//from   w  w w  .j a v  a 2 s.  co m
 */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.list.GetUserListSubscriptions [screen name]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        long cursor = -1;
        PagableResponseList<UserList> lists;
        do {
            lists = twitter.getUserListSubscriptions(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);
    }
}