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 › Twitter4J 401 error
Page Index Toggle Pages: 1
Twitter4J 401 error (Read 1982 times)
Twitter4J 401 error
Jan 4th, 2010, 9:11am
 
Hi guys,

Looking for a good way to tweet with processing. I'm quiet new to processing so maybe this is just a noob mistake =)
I found the example on yusuke.homeip. I get the error: "Cannot find anything named "LatestStatus". Here is my code:
Code:
import twitter4j.org.json.*;
import twitter4j.*;
import twitter4j.http.*;
import twitter4j.examples.*;


Twitter twitter = new Twitter("***","***");
   Status status = twitter.updateStatus(latestStatus);
   System.out.println("Successfully updated the status to [" + status.getText() + "].");


When googling for another I came across an other code snippet. But here I get a 401 error. I suggest I get this error because processing can't connect with the twitter interface?

Here is my code:
Code:

import twitter4j.org.json.*;
import twitter4j.*;
import twitter4j.http.*;
import twitter4j.examples.*;

Twitter twitter;
int friendCount;
User[] friends;
String username = "***";
String password = "***";

java.util.List statuses =null;

twitter = new Twitter(username,password);

try
{
Status status1 = twitter.update("Twitter on Processing");
}
catch( TwitterException e)  {
println(e.getStatusCode());
}


Thanks in advance for helping me to get this thing running!

Cheers,
Oliver
Re: Twitter4J 401 error
Reply #1 - Jan 4th, 2010, 9:28am
 
I uploaded a working example for you .
the part in the code and data folder is important.

http://dl.dropbox.com/u/1152794/sendingTweet.zip
Re: Twitter4J 401 error
Reply #2 - Jan 4th, 2010, 9:38am
 
Hi Cedric,

First of all thanks for the super quick reply! I still get the 401 error feedback. I unzipped the sketch and ran it..

Maybe I'm doing something wrong? Do I need to make changes to the 'build.xml' or 'pom.xml' I guess not!? Or is this a OSX issue maybe? Probably it's just my noobism =)

Thanks!
Oliver
Re: Twitter4J 401 error
Reply #3 - Jan 4th, 2010, 9:47am
 
hmm. Cant tell you what the problem is. I am using Vista. Maybe it is an osx problem.
Re: Twitter4J 401 error
Reply #4 - Jan 4th, 2010, 9:53am
 
Found the problem.. Next time I need to fill in the right password before asking the question. But nevertheless thanks for your help!!

There was also something wrong with my sketch but your sketch works fine! Thanks man!

Cheers,
Oliver
Re: Twitter4J 401 error
Reply #5 - Jan 4th, 2010, 10:49am
 
hehe good, so i helped you anyway Smiley
Page Index Toggle Pages: 1