Getting Started

In this section we will download the necessary software and libraries and create a Twitter ‘application’ online which we will use when writing our Processing sketch.

1. Setting Things Up

Firstly, make sure you have done the following:

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

1.1 Installing the Twitter4J library

  1. Download version 3.05 of the library from http://twitter4j.org
  2. Unzip the downloaded file and copy the folder to your Processing folder and put it in the ‘libraries’ folder (create one if you don’t have one).
  3. Rename the containing folder from twitter4j-3.0.5 to twitter4j305
  4. Inside the twitter4j305 folder, create a folder called ‘library’
  5. From the ‘lib’ folder (also inside twitter4j303), copy the file named twitter4j-core-3.0.5.jar to the ‘library’ folder you just created
  6. Inside the ‘library’ folder, rename the file we just copied from twitter4j-core-3.0.5.jar to twitter4j305.jar
  7. Check that you have the following hierarchy : [PATH TO YOUR PROCESSING FOLDER]/Processing/libraries/twitter4j305/library/twitter4j305.jar

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…

  1. Go to dev.twitter.com
  2. Sign in with your Twitter account
  3. Once you are signed in, hover over your avatar in the top right of the screen and choose ‘My Applications’
  4. On the resulting page, click the button that says ‘Create a New Application’
  5. 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).
  6. Read the terms and conditions and if you agree to them tick the box and proceed with creating your application.
  7. 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.
  8. 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.