Skip to content

Instantly share code, notes, and snippets.

@noff
Created September 14, 2013 08:15
Show Gist options
  • Save noff/6559889 to your computer and use it in GitHub Desktop.
Save noff/6559889 to your computer and use it in GitHub Desktop.
Calls to graph_post_search_get have exceeded the rate of 10000 calls per 1 seconds. [HTTP 400]
app_id = "XXX";
app_secret = "YYY";
@oauth = Koala::Facebook::OAuth.new(app_id, app_secret)
app_oauth_token = @oauth.get_app_access_token
graph = Koala::Facebook::API.new(app_oauth_token)
while(true) do
tags = Tag.current_broadcasting
all_posts = graph.batch do |batch_api|
tags.each do |tag|
batch_api.search(tag, {:type => 'post', :since => since, :until => 'now'})
end
end
all_posts.each do |posts|
posts.each do |post|
...
end
end
sleep 10
end
$ RAILS_ENV=production ruby lib/daemons/facebook_tracker.rb
/home/rails/projectname/shared/bundle/ruby/1.9.1/gems/koala-1.7.0rc1/lib/koala/api/graph_api.rb:500:in block in graph_call': type: OAuthException, code: 613, message: (#613) Calls to graph_post_search_get have exceeded the rate of 10000 calls per 1 seconds. [HTTP 400] (Koala::Facebook::ClientError)
from /home/rails/projectname/shared/bundle/ruby/1.9.1/gems/koala-1.7.0rc1/lib/koala/api.rb:62:in api'
from /home/rails/projectname/shared/bundle/ruby/1.9.1/gems/koala-1.7.0rc1/lib/koala/api/graph_api.rb:498:in graph_call'
from /home/rails/projectname/shared/bundle/ruby/1.9.1/gems/koala-1.7.0rc1/lib/koala/api/graph_api.rb:313:in search'
from lib/daemons/facebook_tracker.rb:40:in block in <main>'
from /home/rails/projectname/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/relation/delegation.rb:6:in each'
from /home/rails/projectname/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/relation/delegation.rb:6:in each'
from lib/daemons/facebook_tracker.rb:38:in <main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment