For tedious reasons to do with hpricot, I need to write a function that is passed a URL, and returns the whole contents of the page as a single string.
I'm close. I know I need to use open-uri, and it should look something like this:
require 'open-uri'
open(url) {
# do something mysterious here to get page_string
}
puts page_string
Please could anyone suggest what I need to add? I am new to Ruby, so finding all the open-uri documentation hard to parse.