Example usage for twitter4j Twitter destroyUserListSubscription

List of usage examples for twitter4j Twitter destroyUserListSubscription

Introduction

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

Prototype

UserList destroyUserListSubscription(long listId) throws TwitterException;

Source Link

Document

Unsubscribes the authenticated user form the specified list.

Usage

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

License:Apache License

/**
 * Usage: java twitter4j.examples.list.DestroyUserListSubscription [list id]
 *
 * @param args message//from   w  w  w.jav a  2  s.  c o m
 */
public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Usage: java twitter4j.examples.list.DestroyUserListSubscription [list id]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        twitter.destroyUserListSubscription(Integer.parseInt(args[0]));
        System.out.println("Successfully unsubscribed the list.");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to unsubscribe the list: " + te.getMessage());
        System.exit(-1);
    }
}