Announcement Announcement Module
Collapse
No announcement yet.
Rate limit info on Twitter object Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rate limit info on Twitter object

    I couldn't find any rate limit information on Twitter object. Are you folks planning to implement it or did I miss it? This could be useful if I am searching and paginating through results.

    Thanks
    Binnyg

  • #2
    What did you have in mind? We have considered providing more rate limit info through the API bindings (it's not just a Twitter problem), but want to make sure we address it as consistently as possible for all providers (or, at least to start, for Facebook and Twitter).

    Some things that could be done is to somehow expose the values of the "X-RateLimit" "X-FeatureRateLimit" headers, provide more details in the RateLimitExceededException, or (for Twitter) simply expose the "account/rate_limit_status" endpoint. All of these are worth consideration. As a starting point, I'll definitely consider adding "account/rate_limit_status" to the Twitter API binding, since it's simple enough to implement (I created https://jira.springsource.org/browse/SOCIALTW-16 to track this). But if you have any specific ideas, we'd be happy to hear them.

    Comment


    • #3
      Thanks for the ticket. I need to read up more on API bindings. Newbie(~3 hours) to Spring Social and scratching the surface now.

      I was looking at example applications(spring-social-showcase) and couldn't find an easy way to access the remainigHits and resetTime as I extensively use them to pause execution when reaching rate limits. I am currently using Twitter4J and would like to port my application to spring-social.

      If I understood it right, I can still do it with Twitter4j API bindings(spring-social-twitter4j) but would be nice if core provides a way to find the rate limit something like (http://twitter4j.org/en/javadoc/twit...mitStatus.html).

      Comment


      • #4
        Then I think you'll find what I'll be doing for SOCIALTW-16 to be useful. I've got a rough cut of it implemented right now, but it still doesn't handle the rate limit data for photos (AFAICT, neither does Twitter4J). I'll go ahead and get it ready and merge it into master (it's in my own fork of Spring Social Twitter now) and let you know so you can try it from the snapshot build.

        Comment


        • #5
          Thank you. I will watch the ticket.

          Comment


          • #6
            Go ahead and try the latest snapshot and let me know what you think. UsersOperations.getRateLimitStatus() is the method you want to try.

            Note that it still doesn't do photo rate limits, but I intend to add that. When I do add it, the RateLimitStatus object will very likely change. I'm considering some options, one of which would involve a breaking change to RateLimitStatus...but the other options would not be breaking changes. Just be aware that this is a first cut and is subject to change.

            Comment


            • #7
              Didn't get a chance to test this yet. It is on hold for now. Craig, I appreciate your fast response. I Will update my findings when I work on this.

              Comment

              Working...
              X