Package twitter4j

Examples of twitter4j.UploadedMedia


            Twitter twitter = new TwitterFactory().getInstance();
           
            long[] mediaIds = new long[args.length-1];
            for (int i=1; i<args.length; i++) {
                System.out.println("Uploading...[" + i + "/" + (args.length-1) + "][" + args[i] + "]");
                UploadedMedia media = twitter.uploadMedia(new File(args[i]));
                System.out.println("Uploaded: id=" + media.getMediaId()
                        + ", w=" + media.getImageWidth() + ", h=" + media.getImageHeight()
                        + ", type=" + media.getImageType() + ", size=" + media.getSize());
                mediaIds[i-1] = media.getMediaId();
            }
           
            StatusUpdate update = new StatusUpdate(args[0]);
            update.setMediaIds(mediaIds);
            Status status = twitter.updateStatus(update);
View Full Code Here

TOP

Related Classes of twitter4j.UploadedMedia

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.