Friends list of a friend using Twitter4J

前端 未结 7 888
旧时难觅i
旧时难觅i 2021-01-12 23:40

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

Using getFriendsId(), I\'m only able to retrieve the friend\'s/follower\'s list of that cu

7条回答
  •  孤城傲影
    2021-01-13 00:20

    You can use

    twitter.getFollowersIDs("username", cursor);
    

    http://twitter4j.org/javadoc/twitter4j/api/FriendsFollowersResources.html#getFollowersIDs-java.lang.String-long- which returns only 5000 user not all users. Also it is limited 15 times in 15 minutes.(https://dev.twitter.com/rest/reference/get/friends/ids)

    Also, you can use,

    twitter.getFollowersList("username", cursor);
    

    http://twitter4j.org/javadoc/twitter4j/api/FriendsFollowersResources.html#getFollowersList-java.lang.String-long- which is also limited with 20 user. Also it is limited 15 times in 15 minutes for user auth, 30 times in 15 minutes for app auth (https://dev.twitter.com/rest/reference/get/friends/list)

    For unlimited access, you can look at https://gnip.com/ or whitelisted user access of twitter.

提交回复
热议问题