Skip to content

Instantly share code, notes, and snippets.

@josephglanville
Created February 28, 2016 04:16
Show Gist options
  • Save josephglanville/2c0279f5e4938f9446d6 to your computer and use it in GitHub Desktop.
Save josephglanville/2c0279f5e4938f9446d6 to your computer and use it in GitHub Desktop.
Gets list of currently included packages in the Cedar-14 stack
require 'mechanize'
mechanize = Mechanize.new
page = mechanize.get('https://devcenter.heroku.com/articles/cedar-ubuntu-packages')
rows = page.xpath('/html/body/div/div/div/article/table/tr')
pkgs = rows.map {|r| r.xpath('td').map {|e| e.text.strip}}
pkgs.each do |pkg|
if pkg[2] != "absent"
puts pkg[0]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment