Home > Java, Twitter > Posting a tweet using Java

Posting a tweet using Java

February 27, 2015 Leave a comment Go to comments

You can’t believe, how easy and fast to tweet using java. yes, it is possible with the help of java library called ‘twiiter4j’. you can download the library  http://twitter4j.org from this site and use it.  consider the following code

    Twitter twitter = TwitterFactory.getSingleton();
    Status status = twitter.updateStatus(latestStatus);
    System.out.println("Successfully updated the status to [" + status.getText() + "].");

use this code in your main function. this code will post your tweet into your timeline.  find more example at http://twitter4j.org/en/code-examples.html . It is really easy to use and make it working with twitter4j. so enjoy java programming.

Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: