Hi,
should this Pickaxe example work on win?
http://www.rubycentral.com/book/tut_io.html
--------------------------------
require 'net/http'
h = Net::HTTP.new('www.pragmaticprogrammer.com', 80)
resp, data = h.get('/index.html', nil)
if resp.message == "OK"
data.scan(/<img src="(.*?)"/) { |x| puts x }
end
--------------------------------
It doesn't with my setup:
ruby -v
ruby 1.6.3 (2001-03-19) [i386-cygwin]
Tobi
--
Tobias Reif
http://www.pinkjuice.com/myDigitalProfile.htm
P.S.
this attempt doesn't work either:
------------------------------
require 'net/http'
socklet = Net::HTTP.new
socklet.start( address = 'www.pragmaticprogrammer.com', port = 80,
proxy_addr = nil, proxy_port = nil )
data = socklet.get('/index.html', nil)
data.scan(/<img src="(.*?)"/) { |x| puts x }
---------------------------