Example usage for twitter4j UserList getId

List of usage examples for twitter4j UserList getId

Introduction

In this page you can find the example usage for twitter4j UserList getId.

Prototype

long getId();

Source Link

Document

Returns the id of the list

Usage

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

License:Apache License

/**
 * Usage: java twitter4j.examples.list.GetUserLists [list owner screen name]
 *
 * @param args message/*from w w w.  j  av  a2  s . c o m*/
 */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.list.GetUserLists [list owner screen name]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        ResponseList<UserList> lists = twitter.getUserLists(args[0]);
        for (UserList list : lists) {
            System.out.println("id:" + list.getId() + ", name:" + list.getName() + ", description:"
                    + list.getDescription() + ", slug:" + list.getSlug() + "");
        }
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to list the lists: " + te.getMessage());
        System.exit(-1);
    }
}

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

License:Apache License

/**
 * Usage: java twitter4j.examples.list.GetUserListSubscriptions [screen name]
 *
 * @param args message/*from w ww .j  a  v  a2s  .  c  om*/
 */
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);
    }
}

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

License:Apache License

/**
 * Usage: java twitter4j.examples.list.ShowUserList [list id]
 *
 * @param args message//from  w ww .j  a  v  a 2s . co  m
 */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.list.ShowUserList [list id]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        UserList list = twitter.showUserList(Integer.parseInt(args[0]));
        System.out.println("id:" + list.getId() + ", name:" + list.getName() + ", description:"
                + list.getDescription() + ", slug:" + list.getSlug() + "");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to show the list: " + te.getMessage());
        System.exit(-1);
    }
}