Created
March 10, 2015 03:16
-
-
Save gtd/f6822bb44c9a99e7d297 to your computer and use it in GitHub Desktop.
review honeybadger error users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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