Package twitter4j

Examples of twitter4j.TwitterFactory


        conf = cb.build();
    }

    public TwitterLoginInformation createLoginInformation(String redirectURL) throws TwitterException {
        Twitter twitter = new TwitterFactory(conf).getInstance();
        String callbackURL = PartakeConfiguration.toppath() + "/auth/verifyForTwitter";
        RequestToken requestToken = twitter.getOAuthRequestToken(callbackURL);

        return new TwitterLoginInformation(twitter, requestToken, redirectURL);
    }
View Full Code Here


    }

    @Override
    public void sendDirectMesage(String token, String tokenSecret, long twitterId, String message) throws TwitterException {
        AccessToken accessToken = new AccessToken(token, tokenSecret);
        Twitter twitter = new TwitterFactory(conf).getInstance(accessToken);
        twitter.sendDirectMessage(twitterId, message);
    }
View Full Code Here

    }

    @Override
    public void updateStatus(String token, String tokenSecret, String message) throws TwitterException {
        AccessToken accessToken = new AccessToken(token, tokenSecret);
        Twitter twitter = new TwitterFactory(conf).getInstance(accessToken);
        twitter.updateStatus(message);
    }
View Full Code Here

        return cfg;
    }

    @Activate
    protected void activate() {
        this.factory = new TwitterFactory(buildConfiguration());
    }
View Full Code Here

  @Test
  public void send() throws TwitterException
  {
     // The factory instance is re-useable and thread safe.
      Twitter twitter = new TwitterFactory().getInstance("geodojo","latinoware");
      Status status = twitter.updateStatus("Testando o  twitter4j");
      System.out.println("Successfully updated the status to [" + status.getText() + "].");
  }
View Full Code Here

   
  }
 
  private void updateTwitter() throws TwitterException
  {
      Twitter twitter = new TwitterFactory().getInstance(this.twitt.getAutor(),this.passwd);
      twitter.updateStatus(this.twitt.getMensagem(),new GeoLocation(this.twitt.getLocation().getY(),this.twitt.getLocation().getX()));   
  }
View Full Code Here

    public static void main(String ... args) throws TwitterException, IOException {
        String consumerKey = "Di1ZjpaZBqBTuCNBMmQ0g";
        String consumerSecret = "Qsa832hZ0z6Di2AY1umfhAgPowf2YtjCxQvooRzXTM";

        Twitter twitter = new TwitterFactory().getInstance();
        twitter.setOAuthConsumer(consumerKey,consumerSecret);
        RequestToken requestToken = twitter.getOAuthRequestToken();
        AccessToken accessToken = null;

        p("go to this url: " + requestToken.getAuthorizationURL());
View Full Code Here

            ChangeSettingsAction csa = new ChangeSettingsAction(context, false);
            csa.execute();
            if(!context.getSettings().containsKey(TWITTER_TOKEN)) return;

            twitter = new TwitterFactory().getInstance();
            twitter.setOAuthConsumer(consumerKey,consumerSecret);
            token = new AccessToken(context.getSettings().getProperty(TWITTER_TOKEN), context.getSettings().getProperty(TWITTER_TOKEN_SECRET));
            twitter.setOAuthAccessToken(token);
            //u.p("my id = " + twitter.getId());
View Full Code Here

        }

        @Override
        public void execute() {
            try {
                final Twitter twitter = new TwitterFactory().getInstance();
                twitter.setOAuthConsumer(consumerKey,consumerSecret);

                if(!context.getSettings().containsKey(TWITTER_TOKEN) || force) {
                    //u.p("no auth info already");
                    final RequestToken requestToken = twitter.getOAuthRequestToken();
View Full Code Here

     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException, TwitterException {
        response.setContentType("text/xml;charset=UTF-8");
        PrintWriter out = response.getWriter();       
        Twitter twitter = new TwitterFactory().getInstance();
        List<User> followers = getFollowersUsers(twitter, "latinoware");
        String template = "<entry>"
                + "<title>%s</title>"
                + "<link rel=\"alternate\" type=\"text/html\" href=\"%s\" />"
                + "<id>%s</id>"
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.