Java – friends list of friends who use twitter4j

How can I use twitter4j to get a friend list of friends or fans?

Using getfriendsid (), I can only retrieve the list of friends / followers of the current authenticated user What I want is to get a list of authenticated users' followers or friends

Solution

This will display the names of your friends' fans

User u1 = null ;
      long cursor = -1;
      IDs ids;
      System.out.println("Listing followers's ids.");
      do {
              ids = twitter.getFollowersIDs("username",cursor);
          for (long id : ids.getIDs()) {
              System.out.println(id);
              User user = twitter.showUser(id);
              System.out.println(user.getName());
          }
      } while ((cursor = ids.getNextCursor()) != 0);
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>