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

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…

Examples

Searching Twitter for Tweets

{{{#java

import twitter4j.conf.*; import twitter4j.internal.async.*; import twitter4j.internal.org.json.*; import twitter4j.internal.logging.*; import twitter4j.json.*; import twitter4j.internal.util.*; import twitter4j.management.*; import twitter4j.auth.*; import twitter4j.api.*; import twitter4j.util.*; import twitter4j.internal.http.*; import twitter4j.*; import twitter4j.internal.json.*;

import java.util.*;

Twitter twitter; String searchString = "pdeng"; List<Status> tweets;

int currentTweet;

void setup() {

}

void draw() {

}

void getNewTweets() {

}

void refreshTweets() {

} }}}