I am using twitter4J to get a user's friends timeline, but it is not returning the full available history. I know there are pagination limits (200 per request and 3200 total as per http://bit.ly/ck8ysq) and I am well within those. I make a request like so:
private static final int MAX_COUNT = 200;
private List<Status> getAllStatuses(long sinceID) throws TwitterException {
Twitter twitter = new Twitter(username, password);
List<Status> friendsTimelineList = new ArrayList<Status>();
List<Status> tempList;
int page = 0;
do {
page++;
tempList = twitter.getFriendsTimeline(
new Paging(page, MAX_COUNT, sinceID));
if(tempList == null )
break;
friendsTimelineList.addAll(tempList);
} while(true);
return friendsTimelineList;
}
This results in only 423 statuses being returned across 3 pages. Any idea why this might be happening?