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 & HelpSyntax Questions › manipulating twitter status using jtwitter
Page Index Toggle Pages: 1
manipulating twitter status using jtwitter (Read 1015 times)
manipulating twitter status using jtwitter
Feb 10th, 2010, 8:45pm
 
I want to get twitter status using processing and get certain keywords from the status.

I am using jTwitter and I can print twitter status on the console using:
println(myTwitter.getStatus("myTwitterAccount"));

If I understand correctly, getStatus() returns String. Is it possible for me to store the String in another variable so that I can manipulate? How?

This my first attempt at making an interactive work so your help will be much appreciated...thanks
Re: manipulating twitter status using jtwitter
Reply #1 - Feb 10th, 2010, 10:03pm
 
sure, what about

String newString = myTwitter.getStatus("myTwitterAccount");

?
Re: manipulating twitter status using jtwitter
Reply #2 - Feb 10th, 2010, 10:24pm
 
Hi thanks for replying...

When I ran this:

String newString = myTwitter.getStatus("myTwitterAccount");

I got this message:

"cannot covert from Twitter.Status to String"

Does this mean getStatus doesn't return a String?


Re: manipulating twitter status using jtwitter
Reply #3 - Feb 11th, 2010, 12:21am
 
If you can println() it, you should be able to convert it to a String somehow.

Try:
String newString = "" + myTwitter.getStatus("myTwitterAccount");
Re: manipulating twitter status using jtwitter
Reply #4 - Feb 11th, 2010, 3:48am
 
Hi,

String newString = "" + myTwitter.getStatus("myTwitterAccount");

It works!...Thank you so much
Re: manipulating twitter status using jtwitter
Reply #5 - Feb 11th, 2010, 6:35am
 
Well, on a more canonical way:
String newString = myTwitter.getStatus("myTwitterAccount").toString();

It avoids concatenation...
Page Index Toggle Pages: 1