Example usage for twitter4j Twitter destroyUserList

List of usage examples for twitter4j Twitter destroyUserList

Introduction

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

Prototype

UserList destroyUserList(long listId) throws TwitterException;

Source Link

Document

Deletes the specified list.

Usage

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

License:Apache License

/**
 * Usage: java twitter4j.examples.list.DestroyUserList [list id]
 *
 * @param args message// w w w  .j a va  2s .com
 */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.list.DestroyUserList [list id]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        UserList list = twitter.destroyUserList(Integer.parseInt(args[0]));
        System.out.println(
                "Successfully deleted the list (id:" + list.getId() + ", slug:" + list.getSlug() + ").");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to delete a list: " + te.getMessage());
        System.exit(-1);
    }
}