use of twitter4j.TwitterFactory in project twitter4j by yusuke.
the class DestroyUserList method main.
/**
* Usage: java twitter4j.examples.list.DestroyUserList [list id]
*
* @param args message
*/
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);
}
}
use of twitter4j.TwitterFactory in project twitter4j by yusuke.
the class ShowUserList method main.
/**
* Usage: java twitter4j.examples.list.ShowUserList [list id]
*
* @param args message
*/
public static void main(String[] args) {
if (args.length < 1) {
System.out.println("Usage: java twitter4j.examples.list.ShowUserList [list id]");
System.exit(-1);
}
try {
Twitter twitter = new TwitterFactory().getInstance();
UserList list = twitter.showUserList(Integer.parseInt(args[0]));
System.out.println("id:" + list.getId() + ", name:" + list.getName() + ", description:" + list.getDescription() + ", slug:" + list.getSlug() + "");
System.exit(0);
} catch (TwitterException te) {
te.printStackTrace();
System.out.println("Failed to show the list: " + te.getMessage());
System.exit(-1);
}
}
use of twitter4j.TwitterFactory in project twitter4j by yusuke.
the class UpdateUserList method main.
/**
* Usage: java twitter4j.examples.list.UpdateUserList [list id] [new list name] [new description]
*
* @param args message
*/
public static void main(String[] args) {
if (args.length < 3) {
System.out.println("Usage: java twitter4j.examples.list.UpdateUserList [list id] [new list name] [new description]");
System.exit(-1);
}
try {
Twitter twitter = new TwitterFactory().getInstance();
twitter.updateUserList(Integer.parseInt(args[0]), args[1], true, args[2]);
System.out.println("Successfully updated list [" + args[0] + "].");
System.exit(0);
} catch (TwitterException te) {
te.printStackTrace();
System.out.println("Failed to update list: " + te.getMessage());
System.exit(-1);
}
}
use of twitter4j.TwitterFactory in project twitter4j by yusuke.
the class GetMutingUsersIDs method main.
/**
* Usage: java twitter4j.examples.mute.GetMutingUsersIDs
*
* @param args message
*/
public static void main(String[] args) {
try {
Twitter twitter = new TwitterFactory().getInstance();
IDs ids = twitter.getMutesIDs(-1L);
for (long id : ids.getIDs()) {
System.out.println(id);
}
System.out.println("done.");
System.exit(0);
} catch (TwitterException te) {
te.printStackTrace();
System.out.println("Failed to get muting user ids: " + te.getMessage());
System.exit(-1);
}
}
use of twitter4j.TwitterFactory in project twitter4j by yusuke.
the class UpdateProfile method main.
/**
* Usage: java twitter4j.examples.account.UpdateProfile [name] [url] [location] [description]
*
* @param args message
*/
public static void main(String[] args) {
if (args.length < 4) {
System.out.println("Usage: java twitter4j.examples.account.UpdateProfile [name] [url] [location] [description]");
System.exit(-1);
}
try {
Twitter twitter = new TwitterFactory().getInstance();
twitter.updateProfile(args[0], args[1], args[2], args[3]);
System.out.println("Successfully updated profile.");
System.exit(0);
} catch (TwitterException te) {
te.printStackTrace();
System.out.println("Failed to update profile: " + te.getMessage());
System.exit(-1);
}
}
Aggregations