Created
December 2, 2010 06:09
-
-
Save juno/724862 to your computer and use it in GitHub Desktop.
Example implement for heroku info APP_NAME. Requires rest-client and nokogiri.
This file contains 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 'rest_client' | |
require 'nokogiri' | |
resource = RestClient::Resource.new('https://api.heroku.com', 'USERNAME', 'PASSWORD') | |
args = [:get, nil, { | |
'X-Heroku-API-Version' => '2', | |
'User-Agent' => 'my heroku client/1.0', | |
'X-Ruby-Version' => RUBY_VERSION, | |
'X-Ruby-Platform' => RUBY_PLATFORM | |
}].compact | |
doc = Nokogiri::XML(resource['apps/APP_NAME'].send(*args)) | |
puts doc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment