Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gtd
Created March 10, 2015 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtd/f6822bb44c9a99e7d297 to your computer and use it in GitHub Desktop.
Save gtd/f6822bb44c9a99e7d297 to your computer and use it in GitHub Desktop.
review honeybadger error users
api_key = 'KqdN3zU5csyXqoEExjMx'
ma_project_id = '40406'
no_viewing_fault_id = '9518398'
project_id = ma_project_id
fault_id = no_viewing_fault_id
notices_url = "https://api.honeybadger.io/v1/projects/#{project_id}/faults/#{fault_id}/notices?auth_token=#{api_key}"
response = HTTParty.get(notices_url)
start_page = response['num_pages']
users = {}
0.upto(500).each do |i|
page = start_page - 1
@response = HTTParty.get(notices_url + "&page=#{page}")
@response['results'].each do |result|
user_id = result['request']['context']['user_id']
users[user_id] ||= 0
users[user_id] += 1
end
puts users
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment