Created
September 6, 2017 16:44
-
-
Save mrkhutter/e6351a23076e844390b059ef7635db91 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'json' | |
require 'net/http' | |
require 'uri' | |
results = [] | |
deps = %w(insert dependencies here) | |
deps.each do |dep| | |
begin | |
puts "working on #{dep} " | |
uri = URI.parse("https://rubygems.org/api/v1/gems/#{dep}.json") | |
response = Net::HTTP.get_response(uri) | |
json = JSON.parse(response.body) | |
results << (json['source_code_uri'] || json['homepage_uri']) | |
rescue => ex | |
puts "Exception: #{ex}" | |
end | |
end | |
puts results | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment