Report Spam to Twitter - Java Social Media

Java examples for Social Media:Twitter

Description

Report Spam to Twitter

Demo Code

import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.auth.AccessToken;

public class ReportSpam {
    public static void main(String[] args) throws TwitterException {
        if (args.length < 1) {
            System.exit(-1);/*from   w  ww.  j  ava2  s  .  c  om*/
        }

        Twitter twitter = new TwitterFactory().getInstance();
        String consumerKey = "";
        String consumerSecret = "";
        String accessToken = "";
        String accessTokenSecret = "";

        twitter.setOAuthConsumer(consumerKey, consumerSecret);
        twitter.setOAuthAccessToken(new AccessToken(accessToken,
                accessTokenSecret));

        twitter.reportSpam(args[0]);
        System.out.println("@" + args[0]);
    }
}

Related Tutorials