System.out.println("Usage: java twitter4j.examples.media.TwitpicImageUpload [API key] [image file path] [message]");
System.exit(-1);
}
try {
Configuration conf = new ConfigurationBuilder().setMediaProviderAPIKey(args[0]).build();
ImageUpload upload = new ImageUploadFactory(conf).getInstance(MediaProvider.TWITPIC);
String url;
if (args.length >= 3) {
url = upload.upload(new File(args[1]), args[2]);
} else {
url = upload.upload(new File(args[1]));