Announcement Announcement Module
Collapse
No announcement yet.
Twitter friendOperations().getFollowers(String screenName) returns only 100 followers Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Twitter friendOperations().getFollowers(String screenName) returns only 100 followers

    Twitter friendOperations().getFollowers(String screenName) returns only 100 followers list, how can i retrieve all the followers or only 200 followers??

  • #2
    Good catch. The "statuses/followers" resource consumed within getFollowers() only returns 100 users worth of info. Even then, Twitter recently deprecated that resource and suggests to use "followers/ids" followed by "users/lookup" instead.

    I've created https://jira.springsource.org/browse/SOCIAL-210 to track this. In the meantime, you can accomplish the same thing by calling getFollowerIds(), then breaking the results down into 100-entry (or less) sublists and calling UserOperations.getUsers() for each sublist.

    Comment


    • #3
      I've just pushed a nightly build of the Twitter module that removes the use of those deprecated resources and uses the Twitter-recommended approach (1 call to get the IDs + 1 call for every 100 IDs). Give it a try and let me know if that works for you.

      FWIW, although this approach will give you all of your followers and is the Twitter-recommended way, be mindful that getFollowers() and getFriends() result in multiple calls to Twitter for resources that are rate-limited. If all you need are the IDs, consider calling getFriendIds() or getFollowerIds() instead. Or if you just need *some* of the friends/followers, collect those IDs and call UserOperations.getUsers().

      Comment


      • #4
        Thank you for replying, i will try this .

        Comment


        • #5
          I tried getFollowerIds("ScreenName") for one of the user who has more than 20,000 followers but it returns me only 5000 records, i took the latest spring-social-showcase example . Is there anything else that am missing ??

          Comment


          • #6
            Wow...20,000 followers! I can honestly say I didn't test for that scenario. But yes, the followers/ids and friends/ids resources return up to 5000 records. But I think it's possible to get more than 5000 (but it will require additional calls to the REST API).

            I've created https://jira.springsource.org/browse/SOCIALTW-4 to look into this.

            Comment


            • #7
              I suggest we test this on Charlie Sheen ;-)

              Comment


              • #8
                That's an epic suggestion. Winning. :-)

                Comment

                Working...
                X