Mega Code Archive
Send extra header fields with an HTTP request by supplying an optional hash parameter to open
require 'open-uri'
f = open('http://www.rubyinside.com/test.txt',
{'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)'})
puts f.read