Skip to content

Instantly share code, notes, and snippets.

@postmodern
Created February 12, 2013 10:41
Show Gist options
  • Save postmodern/4761490 to your computer and use it in GitHub Desktop.
Save postmodern/4761490 to your computer and use it in GitHub Desktop.
Scraps the release tags from a GitHub project
require 'open-uri'
require 'nokogiri'
unless ARGV.length == 2
puts "usage: #{$0} USER PROJECT"
exit -1
end
url = URI("https://github.com/#{ARGV[0]}/#{ARGV[1]}/tags/")
doc = Nokogiri::HTML(open(url))
doc.search('ol.release-list > li').each do |release|
version = release.at('h4').inner_text.strip
tgz = url.merge(release.at('a.detail-link:last').attr('href'))
puts "#{version}: #{tgz}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment