Skip to content

Instantly share code, notes, and snippets.

@drnic
Created December 19, 2008 00:21
Show Gist options
  • Save drnic/37731 to your computer and use it in GitHub Desktop.
Save drnic/37731 to your computer and use it in GitHub Desktop.
require "hpricot"
Shoes.app do
# Just a simple app, yes?
@title = title "..."
download "https://github.com/?login=drnic&token=mytoken",
# download "https://github.com", :body => { "login" => 'drnic', "token" => '6c131adb79448cb80d166b448c446fb2' }, :method => "GET",
:start => proc { |dl| para "starting..." },
:finish => proc { |dl|
doc = Hpricot(dl.response.body)
para doc.search("title").inner_html
para doc.search("li a").map { |a| a.inner_text }.join(", ")
para "finished"
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment