How to get my followers list [closed]

泄露秘密 提交于 2019-12-13 09:18:11

问题


I couldn't find any best solution for getting Twitter followers list.

Could anyone just provide me code example for this. I couldn't understand how to do this after reading twitter documentation.

There is twitter.getFollowersList(String, long) method but I can't find how to use it.


回答1:


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);

Take a look: Friends list of a friend using Twitter4J



来源:https://stackoverflow.com/questions/16897538/how-to-get-my-followers-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!