Results 1 to 7 of 7

Thread: Rate limit info on Twitter object

  1. #1
    Join Date
    Nov 2011
    Posts
    10

    Thumbs up 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. #2
    Join Date
    Aug 2004
    Posts
    1,072

    Default

    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.
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Nov 2011
    Posts
    10

    Default

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

  4. #4
    Join Date
    Aug 2004
    Posts
    1,072

    Default

    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.
    Craig Walls
    Spring Social Project Lead

  5. #5
    Join Date
    Nov 2011
    Posts
    10

    Default

    Thank you. I will watch the ticket.

  6. #6
    Join Date
    Aug 2004
    Posts
    1,072

    Default

    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.
    Craig Walls
    Spring Social Project Lead

  7. #7
    Join Date
    Nov 2011
    Posts
    10

    Default

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •