Hello MCCV,
I am having a bit of trouble while using your library.
I receive the following error when I try to connect:
Code:onnecting to twitter stream htttp://stream.twitter.com:80/1/statuses/filter.json?locations=-180,-90,180,90
couldn't connect to htttp://stream.twitter.com:80/1/statuses/filter.json?locations=-180,-90,180,90: org.apache.http.conn.HttpHostConnectException: Connection to htytp://stream.twitter.com:80 refused
It appears in your tweetstream and geostream examples. My credentials are correct and I have all files installed...
Hope you can help!
On a separate question: What streams can I follow? I've seen
1/statuses/filter.json?locations=-180,-90,180,90
and
1/statuses/sample.json
My goal is to get a live stream of tweets including a specific keyword. What stream do I use? I have read some of the API Wiki but it's a bit over my head.
My code:
Code:import com.twitter.processing.*;
// this stores how many tweets we've gotten
int tweets = 0;
// and this stores the text of the last tweet
String tweetText = "";
void setup() {
size(800,100);
// set up fonts
PFont font = loadFont("CharcoalCY-24.vlw");
textFont(font, 24);
// set up twitter stream object
TweetStream s = new TweetStream(this, "stream.twitter.com", 80, "1/statuses/filter.json", "***", "***");
s.go();
}
void draw() {
background(0);
fill(255, 0, 0);
// draw a box as many pixels wide as the number of tweets we've seen
rect(20, 20, tweets, 20);
// and draw the text of the last tweet
text(tweetText, 10, 70);
}
// called by twitter stream whenever a new tweet comes in
void tweet(Status tweet) {
// print a message to the console just for giggles if you like
// println("got tweet " + tweet.id());
// store the latest tweet text
tweetText = tweet.text();
// bump our tweet count by one
tweets += 1;
}