更新时间:2023-09-28 17:26:04
要使用Twitter4J获取某个用户的所有帖子,你将不得不作出在多个页面您的要求。
To use Twitter4J to get all posts from a user you'll have to make your request over multiple pages..
下面code基于为例on GitHub的
Below code based of an example on GitHub
Twitter unauthenticatedTwitter = new TwitterFactory().getInstance();
//First param of Paging() is the page number, second is the number per page (this is capped around 200 I think.
Paging paging = new Paging(1, 100);
List<Status> statuses = unauthenticatedTwitter.getUserTimeline("google",paging);
只是循环,并保持抓住新的页面,直到没有新的职位应该工作。
Just loop and keep grabbing new pages until there are no new posts should work.