Created
February 28, 2016 04:16
-
-
Save josephglanville/2c0279f5e4938f9446d6 to your computer and use it in GitHub Desktop.
Gets list of currently included packages in the Cedar-14 stack
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 '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