Twitter in Processing

Get Started with Twitter4J in Processing

Twitter4J is an unofficial Java library for the Twitter API. With Twitter4J, you can easily integrate your Java application with the Twitter service. Twitter4J is an unofficial library.

You can easily use this library in Processing, since Processing is Java. But firstly, make sure you have done the following:

  1. Download and install Processing
  2. Download and install the Twitter4J Java library (see instructions below) 1 Make sure you have a Twitter account

Installing the Twitter4J library

2. Getting an API Key From Twitter / Creating an Application

To obtain the necessary permission to use Processing with Twitter, we need to create an application with an accompanying set of `keys’. To do this…

Go to dev.twitter.com Sign in with your Twitter account Once you are signed in, hover over your avatar in the top right of the screen and choose ‘My Applications’ On the resulting page, click the button that says ‘Create a New Application’ Give your application a name, description and some relevant website (if you are just testing out how things work, say that in the description. Also, the website could just be your personal website if you don’t have one for the application). Read the terms and conditions and if you agree to them tick the box and proceed with creating your application. You will now be taken to a page that shows you some details about your application. You will find there your Consumer Key and your Consumer Secret. Save them to a text file somewhere secure, you will need them in this tutorial. You will see a button towards the bottom called ‘Create my Access Token’. Click this button and when the page reloads you will find two more keys, the Access Token and the Access Token Secret. Store these two keys also, as they will be needed later. Now we can begin writing our Twitter-enabled Processing sketch. Head to the next section to begin writing your Processing sketch.