Skip to content

Instantly share code, notes, and snippets.

@vassilevsky
Created June 16, 2013 21:51
Show Gist options
  • Save vassilevsky/5793574 to your computer and use it in GitHub Desktop.
Save vassilevsky/5793574 to your computer and use it in GitHub Desktop.
BountySource scraper
#!/usr/bin/env ruby
require "httparty"
require "pry"
bounties = []
issue_id = 0
errors_count = 0
until errors_count > 10
issue_id = issue_id + 1
url = "https://api.bountysource.com/issues/#{issue_id}"
print "#{url}..."
sleep 1
response = HTTParty.get(url)
if response.code == 200
print "OK"
errors_count = 0
else
puts response.code
errors_count = errors_count + 1
next
end
bounty = response["bounty_total"].to_f
puts " - #{bounty}"
if bounty > 0
bounties << {url: response["frontend_url"], amt: bounty}
puts "Already #{bounties.count} paid bounties found."
end
end
puts
puts "RESULTS:"
bounties.sort_by! {|bounty| bounty[:amt] }
bounties.each {|bounty| puts "$#{bounty[:amt]} for #{bounty[:url]}" }
@corytheboyd
Copy link

By the way, you can use our QA site for testing: https://www-qa.bountysource.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment