List of usage examples for twitter4j Twitter createUserListSubscription
UserList createUserListSubscription(long listId) throws TwitterException;
From source file:twitter4j.examples.list.CreateUserListSubscription.java
License:Apache License
/** * Usage: java twitter4j.examples.list.CreateUserListSubscription [list id] * * @param args message/*from ww w . j av a 2 s . c o m*/ */ public static void main(String[] args) { if (args.length < 1) { System.out.println("Usage: java twitter4j.examples.list.CreateUserListSubscription [list id]"); System.exit(-1); } try { Twitter twitter = new TwitterFactory().getInstance(); twitter.createUserListSubscription(Integer.parseInt(args[0])); System.out.println("Successfully subscribed the list."); System.exit(0); } catch (TwitterException te) { te.printStackTrace(); System.out.println("Failed to subscribe the list: " + te.getMessage()); System.exit(-1); } }