Example usage for twitter4j Twitter destroyUserListMember

List of usage examples for twitter4j Twitter destroyUserListMember

Introduction

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

Prototype

UserList destroyUserListMember(long listId, long userId) throws TwitterException;

Source Link

Document

Removes the specified member from the list.

Usage

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

License:Apache License

/**
 * Usage: java twitter4j.examples.list.DeleteUserListMember [list id] [user id]
 *
 * @param args message// w  ww .  j  a  v a2 s . c om
 */
public static void main(String[] args) {
    if (args.length < 2) {
        System.out.println("Usage: java twitter4j.examples.list.DeleteUserListMember [list id] [user id]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        twitter.destroyUserListMember(Integer.parseInt(args[0]), Integer.parseInt(args[1]));
        System.out.println("Successfully deleted user [" + args[1] + "] from the list.");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to delete user: " + te.getMessage());
        System.exit(-1);
    }
}