Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

OAuthRateLimitException catch #105

Closed
JoshdotNew opened this Issue · 9 comments

3 participants

JoshdotNew Jonathan Heaton Romain Butteaud
JoshdotNew

I don't see any catch for an OAuthRateLimitException, eventually I get a BadRequest. Do you have a workaround for this?

Jonathan Heaton
Owner

You can query/monitor your remaining requests (see new sample app) or alternatively submit a pull request.

Jonathan Heaton heatonjb closed this
JoshdotNew

I have tried the utils_raw_response and it seems to skip over that line and doesn't return anything. It also isn't throwing any exceptions. I use a lot of the endpoints and don't have any issues. I have attached my code and below is my output:

screen shot 2014-04-15 at 10 42 07 am

[#, #, #, #, #, #, #]
GETTING RATE LIMIT MESSAGE
[#, #, #]
GETTING RATE LIMIT MESSAGE

Jonathan Heaton
Owner

Does the example in the sample app work for you?

JoshdotNew

No it doesn't

Romain Butteaud

@JoshdotNew, I think you are using the version 0.11.0 of the gem. To use response.headers[:x_ratelimit_limit] and response.headers[:x_ratelimit_remaining] you will need to upgrade to 1.0.0 (the master branch here).
In order to do that you need to specify the git repository with this line in your Gemfile: gem 'instagram', :git => "https://github.com/Instagram/instagram-ruby-gem"

@heatonjb, if you think the gem is stable enough, would it be possible to somehow push the current master branch to production to https://rubygems.org/gems/instagram? Especially because the sample application in the README file is using new features that are not in the current default version at rubygems.org (0.11.0) and it might confuse some developers.

JoshdotNew

I actually forked the repository and downloaded it and used that as my gem. I'm using gem 1.0 as far as I know. When I puts the Instagram client it says 1.0.0

JoshdotNew

I added the gem via github per Romain's suggestion and I still don't get the limits or anything returned. Thank you both for your help.

Romain Butteaud

First, I would suggest you to try to make the Sample Application work to understand what could be wrong with your setup. Can you tell us what is the error you have with the Sample App?

JoshdotNew

I have figured it out. Thank you for all of your help it was not a problem with the gem at all. I have a Redis server handling my error logs and it was being inundated to the point where it couldn't record a single error. All good now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.