Package twitter4j

Examples of twitter4j.TwitterFactory


        if (args.length < 1) {
            System.out.println("java twitter4j.examples.spamreporting.ReportSpam [screen name]");
            System.exit(-1);
        }
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            System.out.println("Successfully reported @" + twitter.reportSpam(args[0]).getScreenName() + " as a spammer.");
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to report spam: " + te.getMessage());
            System.exit(-1);
View Full Code Here


        if (args.length < 1) {
            System.out.println("Usage: java twitter4j.examples.friendship.CreateFriendship [screen name]");
            System.exit(-1);
        }
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            twitter.createFriendship(args[0]);
            System.out.println("Successfully followed [" + args[0] + "].");
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
View Full Code Here

     *
     * @param args message
     */
    public static void main(String[] args) {
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            long cursor = -1;
            IDs ids;
            System.out.println("Showing outgoing pending follow request(s).");
            do {
                ids = twitter.getOutgoingFriendships(cursor);
View Full Code Here

     *
     * @param args String[]
     */
    public static void main(String[] args) {
        // gets Twitter instance with default credentials
        Twitter twitter = new TwitterFactory().getInstance();
        try {
            List<Status> statuses;
            String user;
            if (args.length == 1) {
                user = args[0];
View Full Code Here

     *
     * @param args message
     */
    public static void main(String[] args) {
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            long cursor = -1;
            IDs ids;
            System.out.println("Listing followers's ids.");
            do {
                if (0 < args.length) {
View Full Code Here

        if (args.length < 1) {
            System.out.println("Usage: java twitter4j.examples.friendship.DestroyFriendship [screen name]");
            System.exit(-1);
        }
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            twitter.destroyFriendship(args[0]);
            System.out.println("Successfully unfollowed [" + args[0] + "].");
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
View Full Code Here

     *
     * @param args message
     */
    public static void main(String[] args) {
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            long cursor = -1;
            IDs ids;
            System.out.println("Listing following ids.");
            do {
                if (0 < args.length) {
View Full Code Here

        if (args.length < 1) {
            System.out.println("Usage: java twitter4j.examples.tweets.ShowStatus [status id]");
            System.exit(-1);
        }
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            Status status = twitter.showStatus(Long.parseLong(args[0]));
            System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText());
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
View Full Code Here

            System.out.println("Usage: java twitter4j.examples.tweets.RetweetStatus [status id]");
            System.exit(-1);
        }
        System.out.println("Retweeting the status id - [" + args[0] + "].");
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            twitter.retweetStatus(Long.parseLong(args[0]));
            System.out.println("Successfully retweeted status [" + args[0] + "].");
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
View Full Code Here

        if (args.length < 1) {
            System.out.println("Usage: java twitter4j.examples.tweets.UploadMultipleImages [text] [file1] [file2] ...");
            System.exit(-1);
        }
        try {
            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]));
View Full Code Here

TOP

Related Classes of twitter4j.TwitterFactory

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.