Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
HTTP.get problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="daz, post: 4475303"] I would have suspected that, first. You *closed* ZA ? (Not recommended ever, while online, BTW) You should have an entry under programs for: Ruby interpreter 1,8,2,0 For this script you need: Allow connect (Internet) I have "?Ask" Server (Local/Internet) OK, you say it's not a firewall problem. Here's a trace log of what should happen on your version of Ruby. [URL]http://www.d10.karoo.net/ruby/pptrace.txt[/URL] Try running this modified version of your script and report which trace line number you reach. If the last 10-20 lines of your trace vary from mine, post them here and someone who understands this stuff may be able to help. #-------------------------------------------------------- $tr_line = 1 $tr_func = lambda do | ev, fi, li, ty, bi, cl | printf("%04d %14s:%4d %26s %-8s %s\n", $tr_line, File.basename(fi), li, ty, ev, cl) $tr_line += 1 end STDOUT.sync=true require 'net/http' h = Net::HTTP.new('[URL="http://www.pragmaticprogrammer.com"]www.pragmaticprogrammer.com[/URL]', 80) set_trace_func($tr_func) resp, data = h.get('/index.html', nil) set_trace_func(nil) puts 'after get' if resp.message == "OK" data.scan(/<img src="(.*?)"/) { |x| puts x } end #-------------------------------------------------------- daz [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
HTTP.get problem
Top