It's time to get excited about a README file. I just discovered Ruby's Mechanize gem, and all I can say is "wow." It's so BAM. How did I go for so long without appreciating the majesty of this library? Mechanize is a Ruby library that pretends to be a browser, follows redirects, simulates storing cookies, fills out forms, clicks on buttons and links, uploads files, selects out text with CSS selectors .... the only thing it can't do is wipe your butt for you. But if you could figure out how to make a browser do that, then you could automate it with Mechanize.
http://mechanize.rubyforge.org/mechanize/files/GUIDE_txt.html
http://mechanize.rubyforge.org/files/EXAMPLES_txt.html
Check out this nice syntax:
page = agent.get('http://google.com/')
puts page.body
BAM. You've just requested an HTML page.
You want links? We got links:
page.links.each do |link|
puts link.text
end
BAM. That gives you a list of links on the page.
You want to click on a link?
page = agent.click page.links.text('News')
BAM, you're on the next page.
You want to fill out a form?
google_form = page.form('f') # As in,