Twitter4j Twitter OAuth Example

Today I’m going to show you some sample code regarding how to send a tweet to twitter using twitter4j and OAuth. The following code example is a command line twitter client that authenticates a user with oAuth and allows them to post a tweet.

All you need to to create a project in your favourite IDE.. for ease of use. Add the twitter4j library to your build path. Compile and run. If you run into any problems shoot them into the comments and I’ll lend a hand. Happy hacking.

Read More

One Way Tweet a Java App

One way tweet is a sending application for twitter. In this tutorial you will see/learn how to send stuff to twitter by writing a java desktop UI. You will create a new project in NetBeans and choose java application, and create a new package called

Then, create a new java source file and call it, and another called Two simple classes and you’ve got yourself a twitter client. The end result will look like this:
One Way Tweet
Read More

Universal Translator for your Tweets

I thought this was going to be easy… SO much for preconceptions. Today, I’m going to give you the code to create a twitter translation App using, HTML, CSS, JavaScript and Java, the Twitter API and the Google Translate API. In a future tutorial I will demonstrate cross domain Ajax to get this Application to work totally on the client side but in the mean time you will need to have a Java enabled server to execute the server-side JSP that requests the API for twitter.

As you type your tweet the the JavaScript will analyze your keystrokes and check for when a space is entered assuming you are done typing a word, at this point the text is passed to Google for translation. When your done typing hit tweet and it’s off to twitter with your tweet.

This is what your app will look like when it’s finished:



Read More