使用Twitter4J的朋友的好友列表 [英] Friends list of a friend using Twitter4J

查看:207
本文介绍了使用Twitter4J的朋友的好友列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 Twitter4J 获取朋友或粉丝的好友列表?

How can I obtain the friends list of a friend or follower using Twitter4J?

使用 getFriendsId() ,我只能检索经过身份验证的当前用户的朋友/关注者列表。我想要的是获取经过身份验证的用户的关注者或朋友的朋友列表。

Using getFriendsId(), I'm only able to retrieve the friend's/follower's list of that current user which is authenticated. What I want is to obtain the list of friends of a follower or friend of the authenticated user.

推荐答案

long lCursor = -1;
IDs friendsIDs = twitter.getFriendsIDs(userID, lCursor);
System.out.println(twitter.showUser(userID).getName());
System.out.println("==========================");
do
{
  for (long i : friendsIDs.getIDs())
   {
       System.out.println("follower ID #" + i);
       System.out.println(twitter.showUser(i).getName());
   }
}while(friendsIDs.hasNext());

这篇关于使用Twitter4J的朋友的好友列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆