Skip to content

Instantly share code, notes, and snippets.

@juno
Created December 2, 2010 06:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juno/724862 to your computer and use it in GitHub Desktop.
Save juno/724862 to your computer and use it in GitHub Desktop.
Example implement for heroku info APP_NAME. Requires rest-client and nokogiri.
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