List of usage examples for twitter4j Twitter createUserListMembers
UserList createUserListMembers(long listId, long... userIds) throws TwitterException;
From source file:twitter4j.examples.list.CreateUserListMembers.java
License:Apache License
/** * Usage: java twitter4j.examples.list.CreateUserListMembers [list id] [screen name[,screen name..]] * * @param args message// w w w . ja v a 2 s.c o m */ public static void main(String[] args) { if (args.length < 2) { System.out.println( "Usage: java twitter4j.examples.list.CreateUserListMembers [list id] [screen name[,screen name..]]"); System.exit(-1); } try { Twitter twitter = new TwitterFactory().getInstance(); twitter.createUserListMembers(Integer.parseInt(args[0]), args[1].split(",")); System.out.println("Successfully added the user(s) to the specified list."); System.exit(0); } catch (TwitterException te) { te.printStackTrace(); System.out.println("Failed to add a user: " + te.getMessage()); System.exit(-1); } }