我正在使用 Spring Social Twitter 检索用户的朋友姓名。这是我的代码。
@Controller
@RequestMapping("/")
public class HelloController {
private Twitter twitter;
private ConnectionRepository connectionRepository;
@Inject
public HelloController(Twitter twitter, ConnectionRepository connectionRepository) {
this.twitter = twitter;
this.connectionRepository = connectionRepository;
}
@RequestMapping(method=RequestMethod.GET)
public String helloTwitter(Model model) {
if (connectionRepository.findPrimaryConnection(Twitter.class) == null) {
return "redirect:/connect/twitter";
}
model.addAttribute(twitter.userOperations().getUserProfile());
CursoredList<TwitterProfile> friends = twitter.friendOperations().getFriends();
model.addAttribute("friends", friends);
for ( TwitterProfile frnd : friends) {
System.out.println(frnd.getName());
}
return "hello";
}
}
但它只检索到 20 个朋友。我怎么能得到所有的朋友?(假设我有 1000 个朋友)