title: How to get more than 20 results from a user timeline using processing and Twitter4j?
body: <p>I'm trying to make a sketch that gets the last 100 tweets from a specific user's twitter timeline. I'm using Twitter4j and the sketch works fine but I've learned that Twitter4J by default limits the timeline results to 20. </p>
  
  <p>I've seen this page to learn about getting more than 100 when using Queries, but it seems to be working differently when trying to get a specific user's timeline.
  <a href="https://stackoverflow.com/questions/18800610/how-to-retrieve-more-than-100-results-using-twitter4j">How to retrieve more than 100 results using Twitter4j</a></p>
  
  <p>Thanks for looking!</p>
  
  <p>Here is my sketch:</p>
  
  <pre><code>import twitter4j.conf.*;
  import twitter4j.internal.async.*;
  import twitter4j.internal.org.json.*;
  import twitter4j.internal.logging.*;
  import twitter4j.json.*;
  import twitter4j.internal.util.*;
  import twitter4j.management.*;
  import twitter4j.auth.*;
  import twitter4j.api.*;
  import twitter4j.util.*;
  import twitter4j.internal.http.*;
  import twitter4j.*;
  import twitter4j.internal.json.*;
  
  
  ConfigurationBuilder cb = new ConfigurationBuilder();
  
  cb.setOAuthConsumerKey("XXXXXX");
  cb.setOAuthConsumerSecret("XXXXXX");
  cb.setOAuthAccessToken("XXXXXX");
  cb.setOAuthAccessTokenSecret("XXXXXX");
  
  java.util.List statuses = null;
  
  Twitter twitter = new TwitterFactory(cb.build()).getInstance();
  
  String userName ="XXXXXX";
  int numTweets = 100;
  String[] twArray = new String[numTweets];
  
  
  
    try {
      statuses = twitter.getUserTimeline(userName);
    }
    catch(TwitterException e) {
    }
  
    for (int i=0; i&lt;statuses.size(); i++) {
      Status status = (Status)statuses.get(i);
  
      //println(status.getUser().getName() + ": " + status.getText());
      twArray[i] = status.getUser().getName() + ": " + status.getText();
  
    }
  
  
  println(twArray);
  </code></pre>