From: Dick Davies Date: 2004-06-08T20:32:02+09:00 Subject: Re: open-uri / net/http bug? * Chad Fowler [0655 03:55]: > On Sun, 6 Jun 2004 05:02:25 +0900, Dick Davies > > require 'open-uri' > > > > url = 'http://p218.ezboard.com/fdebatingukfrm9' > > page = open(url).readlines > > /data/ruby/lib/ruby/1.9/net/protocol.rb:135:in `sysread': End of file reached (EOFError) > > from /data/ruby/lib/ruby/1.9/net/protocol.rb:135:in `rbuf_fill' > > from /data/ruby/lib/ruby/1.9/net/protocol.rb:116:in `readuntil' > > from /data/ruby/lib/ruby/1.9/net/protocol.rb:126:in `readline' > > from /data/ruby/lib/ruby/1.9/net/http.rb:1850:in `read_status_line' > > from /data/ruby/lib/ruby/1.9/net/http.rb:1839:in `read_new' > > from /data/ruby/lib/ruby/1.9/net/http.rb:934:in `request' > > from /data/ruby/lib/ruby/1.9/net/http.rb:834:in `request_get' > > from /data/ruby/lib/ruby/1.9/open-uri.rb:545:in `proxy_open' > > ... 7 levels... > > from /data/ruby/lib/ruby/1.9/open-uri.rb:134:in `open_uri' > > from /data/ruby/lib/ruby/1.9/open-uri.rb:424:in `open' > > from /data/ruby/lib/ruby/1.9/open-uri.rb:85:in `open' > > from ./regex.rb:6 > It appears to me that this site refuses to respond unless you have a > recognized User-agent set in the request header. That's probably the > problem with open-uri. Ah crap. wget worked fine. Is there a workaround (other than wget'ting the file to a local webserver and pulling it from there)? I can't see an easy way of adding a user-agent header to net/http.rb headers..... -- The District of Columbia has a law forbidding you to exert pressure on a balloon and thereby cause a whistling sound on the streets. Rasputin :: Jack of All Trades - Master of Nuns