However, this won’t give you the output you want. The open method on Open-URI leaves the output in the default character set of the page. If you want to convert it to utf-8, you need to use the iconv library:
require'rubygems'require'iconv'require'open-uri'require'hpricot'
f = open("http://url")
f.rewind
doc = Hpricot(Iconv.conv('utf-8', f.charset, f.readlines.join("\n")))
In January, I gave a presentation at the Orlando Ruby Users Group about unobtrusive javascript. I figured that I’d reproduce it here for anyone who wanted to watch it. Some topics covered in the video include semantic markup, benefits of coding unobtrusively, examples, and guidelines. Special thanks to Gregg Pollack for editing the video, and an extra special thanks to Jason Hawkins from Make Film Work for filming.