hello guys, I'm pretty new to processing and know not much about java
i need a little help using twitter4j..
and i am trying to retrieve my twitter home timeline to processing for further purpose.
i have found some example from RobotGril.com and studied the previous post:
But still can't solve the problem.
- static String OAuthConsumerKey = "XXXXXXXXXXXXX";
- static String OAuthConsumerSecret = "XXXXXXXXXXXXXXXXX";
- // This is where you enter your Access Token info
- static String AccessToken = "XXXXXXXXXXXXXXXXXXXXXX";
- static String AccessTokenSecret = "XXXXXXXXXXXXXXXXXXXXXXX";
- // Just some random variables kicking around
- String myTimeline;
- java.util.List statuses = null;
- User[] friends;
- Twitter twitter = new TwitterFactory().getInstance();
- RequestToken requestToken;
- String[] theSearchTweets = new String[11];
- void setup() {
-
- size(100,100);
- background(0);
- connectTwitter();
- //sendTweet("Hey from Simple Grrl");
- getTimeline();
- }
- void draw() {
- background(0);
-
- }
- // Initial connection
- void connectTwitter() {
- twitter.setOAuthConsumer(OAuthConsumerKey, OAuthConsumerSecret);
- AccessToken accessToken = loadAccessToken();
- twitter.setOAuthAccessToken(accessToken);
- }
- // Loading up the access token
- private static AccessToken loadAccessToken(){
- return new AccessToken(AccessToken, AccessTokenSecret);
- }
- // Get your tweets
- void getTimeline() {
- try {
- statuses = twitter.getHomeTimeline();
- } catch(TwitterException e) {
- println("Get timeline: " + e + " Status code: " + e.getStatusCode());
- }
- for(int i=0; i<statuses.size(); i++) {
- Status status = (Status)statuses.get(i);
- println(status.getUser().getName() + ": " + status.getText());
- }
- }
is reply an error : NumberFormatException: For input string: "100+"
This code is fine, while apply ".getUserTimeline();" in line 57.
Anyone have an idea what's going on?