box-o-sand/lrthw-remnants/ex12.rb
Dan Buch 01e5a4e45f Add 'lrthw-remnants/' from commit '2b0a814a1795c60baf29b95462921b0ec8c7d861'
git-subtree-dir: lrthw-remnants
git-subtree-mainline: f2380eef05
git-subtree-split: 2b0a814a17
2013-01-09 23:47:30 -05:00

11 lines
349 B
Ruby

require 'open-uri'
open("http://www.ruby-lang.org/en") do |f|
f.each_line {|line| p line}
puts f.base_uri # <URI::HTTP:0x40e6ef2 URL:http://www.ruby-lang.org/en/>
puts f.content_type # "text/html"
puts f.charset # "iso-8859-1"
puts f.content_encoding # []
puts f.last_modified # Thu Dec 05 02:45:02 UTC 2002
end