Index \ Search \ Members \ Profile \ Logout \ RSS
Welcome, Guest. Please Login or Register
Page Index Toggle Pages: 1
Send Topic Print
Twitter4J (Read 2056 times)
Twitter4J
Apr 10th, 2009, 3:32am
 
Hey, I was wondering if anybody could please give me a hand with Twitter4J in Processing as I'm getting error messages with my code. I've tried posting in the Integration Forum but nobody replied.

I'm trying to retrieve my latest status message and print them to the console, but when I try to run my code I get the error

"cannot convert from List<Status> to String"

This is my code:
Code:
Twitter twitter;
String myTimeline;
User[] friends;
String username = "myUsername"; // add your own here
String password = "myPassword"; // add your own here
twitter = new Twitter(username,password);

myTimeline = twitter.getUserTimeline();

   println(myTimeline);
 }
}



Any help is greatly appreciated?

Thanks
Re: Twitter4J
Reply #1 - Apr 10th, 2009, 4:41am
 
Try this...

myTimeline = str(twitter.getUserTimeline());
Re: Twitter4J
Reply #2 - Apr 13th, 2009, 12:13pm
 
Hi,

the List is as it says a List. If you want to print out all of the elements you can use a loop, or if you just want to print out the latest update grab the first element in the list and print it. I'm not too sure what would happen if you put str(...), it could just print out the memory address of the list or print everything in the list.

Sorry I can't help anymore.
Re: Twitter4J
Reply #3 - Apr 14th, 2009, 8:12am
 
thanks Smiley ill look into it
Re: Twitter4J
Reply #4 - Oct 22nd, 2009, 7:36pm
 
can you guys help me?
i was trying to port twitter4j to android. successfully no error
and i made sample code like below.
then.
android send unknown host message" twitter.com" , i don't understand why... please somebody help me

Twitter sender = new Twitter("myid", "mypassword");
statuses = sender.getFriendsTimeline();

Page Index Toggle Pages: 1
Send Topic Print
« Home ‹ Board Top of this page