这是我的代码:
int favouritesCount = user.getFavouritesCount();
int followersCount = user.getFollowersCount();
int friendsCount = user.getFriendsCount();
long userId = user.getId();
System.out.println("FavouritesCount: " + favouritesCount + ", followersCount: " + followersCount + ", friendsCount: " + friendsCount);
ArrayList<User> followers = new ArrayList<User>();
long nextCursor = 0;
do {
PagableResponseList<User> usersResponse = twitter.getFollowersList(user.getScreenName(), nextCursor);
System.out.println("size() of first iteration:" + usersResponse.size());
nextCursor = usersResponse.getNextCursor();
followers.addAll(usersResponse);
} while ( nextCursor > 0);
System.out.println( followers.size() > 0 ? "Getting followers:" : "No followers.");
for ( User user : followers) {
System.out.println(user.getScreenName() + ", id: " + user.getId());
}
这是我得到的输出:
FavouritesCount: 0, followersCount: 1, friendsCount: 1
size() of first iteration:0
No followers.
我在这里做错了什么?用户通过OAuth进行身份验证,一切都很好,除了这部分代码根本不起作用。跟随者和朋友的数量是正确的,但我有看到粉丝的问题。
请帮忙!
最佳, d
答案 0 :(得分:5)