Example usage for twitter4j Twitter updateUserList

List of usage examples for twitter4j Twitter updateUserList

Introduction

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

Prototype

UserList updateUserList(long listId, String newListName, boolean isPublicList, String newDescription)
        throws TwitterException;

Source Link

Document

Updates the specified list.

Usage

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

License:Apache License

/**
 * Usage: java twitter4j.examples.list.UpdateUserList [list id] [new list name] [new description]
 *
 * @param args message/*from w ww.j  av  a 2s .co m*/
 */
public static void main(String[] args) {
    if (args.length < 3) {
        System.out.println(
                "Usage: java twitter4j.examples.list.UpdateUserList [list id] [new list name] [new description]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        twitter.updateUserList(Integer.parseInt(args[0]), args[1], true, args[2]);
        System.out.println("Successfully updated list [" + args[0] + "].");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to update list: " + te.getMessage());
        System.exit(-1);
    }
}