Package twitter4j

Examples of twitter4j.Twitter.updateStatus()


    @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


  @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()));   
  }
 
  private void persistGeoTwitt()
  {
    this.em.getTransaction().begin();
View Full Code Here

        p("got the access token: " + accessToken);
        storeAccessToken(twitter.verifyCredentials().getId() , accessToken);

        AccessToken toke = new AccessToken(accessToken.getToken(), accessToken.getTokenSecret());
        twitter.setOAuthAccessToken(accessToken);
        Status status = twitter.updateStatus("quick test of twitter with oauth. hope this works! :)");
        p("changed the status to : " + status.getText());
    }

    private static void storeAccessToken(int useId, AccessToken accessToken){
        p("id = " + useId);
View Full Code Here

            String msg = b.toString();
            if (msg.length() > 140)
                msg = msg.substring(0, 140);

            Status status = twitter.updateStatus(msg);

            result = SenderResult.getSimpleSuccess("Send notification - msg-id: " + status.getId());
        } catch (TwitterException e) {

            log.warn("Notification via Microblog failed!", e);
View Full Code Here

            }

            String message = configuration.getSimpleValue("message",null);

            Twitter twitter = createTwitterInstance();
            Status status = twitter.updateStatus(message);
            @SuppressWarnings({"UnnecessaryLocalVariable"})
            OperationResult result = new OperationResult("Posted " + status.getText());

            return result;
View Full Code Here

        //persist to the accessToken for future reference.
        System.out.println(twitter.verifyCredentials().getId());
        System.out.println("token : " + accessToken.getToken());
        System.out.println("tokenSecret : " + accessToken.getTokenSecret());
        //storeAccessToken(twitter.verifyCredentials().getId() , accessToken);
        Status status = twitter.updateStatus(args[0]);
        System.out.println("Successfully updated the status to [" + status.getText() + "].");
        System.exit(0);
    }
}
View Full Code Here

        // Titterオブジェクトの生成
        TwitterFactory twitterFactory = new TwitterFactory(cb.build());
        Twitter twitter = twitterFactory.getInstance();

        twitter.updateStatus(msg);
    }

    /**
     * Twitter Post
     * @param userModel
View Full Code Here

            }
            System.out.println("Got access token.");
            System.out.println("Access token: "+ accessToken.getToken());
            System.out.println("Access token secret: "+ accessToken.getTokenSecret());

            Status status = twitter.updateStatus(args[0]);
            System.out.println("Successfully updated the status to [" + status.getText() + "].");
            System.exit(0);
        } catch (TwitterException te) {
            System.out.println("Failed to get timeline: " + te.getMessage());
            System.exit( -1);
View Full Code Here

            System.out.println(
                "Usage: java twitter4j.examples.Update ID Password text");
            System.exit( -1);
        }
        Twitter twitter = new Twitter(args[0], args[1]);
        Status status = twitter.updateStatus(args[2]);
        System.out.println("Successfully updated the status to [" + status.getText() + "].");
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.