Welcome to the new Spring.io forums!
If this is your first visit, be sure to check out the
by clicking the link above, and for security reasons, use the
forgot password link to reset your password..
You may have to register before you can post: click the register
link above to proceed. To start viewing messages, select the forum that you want to visit
from the selection below.
No announcement yet.
Rate limit info on Twitter objectPage Title Module
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.
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.
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.
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.