We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Can't connect to Twitter
Page Index Toggle Pages: 1
Can't connect to Twitter (Read 539 times)
Can't connect to Twitter
Dec 17th, 2009, 7:00am
 
I'm using the twitter4j library to connect to twitter and have put in some sample code. I don't get any error messages, but keep getting connection timed out. I can log into twitter fine in my browser

Here's the code:

Twitter myTwitter;
void setup() {
myTwitter = new Twitter("facebook_is_pap", "********");
try {

   Query query = new Query("death");
   query.setRpp(100);
   QueryResult result = myTwitter.search(query);

   ArrayList tweets = (ArrayList) result.getTweets();

   for (int i = 0; i < tweets.size(); i++) {
     Tweet t = (Tweet) tweets.get(i);
     String user = t.getFromUser();
     String msg = t.getText();
     Date d = t.getCreatedAt();
     println("Tweet by " + user + " at " + d + ": " + msg);
   };

 }
 catch (TwitterException te) {
   println("Couldn't connect: " + te);
 };
};

void draw() {

};

Can anyone help? Don't think it's a coding problem, is the twitter api faulty with connecting?
Page Index Toggle Pages: 1