From: Mohammad Khan Date: 2004-05-26T23:09:05+09:00 Subject: Re: Checking that an URL exists Try this: ################################################### #!/usr/bin/ruby require 'net/http' h = Net::HTTP.new(ARGV[0] || 'www.nonexist-ruby-lang.org', 80) url = ARGV[1] || '/' begin resp, data = h.get(url, nil) { |a| } puts "Valid URL" rescue Net::ProtoRetriableError =>detail puts "Retriable URL" rescue puts "Not a Valid URL" end #################################################### ----- Original Message ----- From: "Imobach Gonz�lez Sosa" To: "ruby-talk ML" Sent: Wednesday, May 26, 2004 8:55 AM Subject: Checking that an URL exists Hi all, Well, I want to make a little script that checks if the URLs in my bookmarks are OK (in other words, if they are online yet). I've been hanging around with URI classes and I've seen clearly a function that performs that check. I've tried using open-uri.rb but, if open method fails, the script fails. Any ideas? Thanks in advance. -- EuropeSwPatentFree (o_.' Imobach Gonz�lez Sosa imobachgs@softhome.net //\c{} imobachgs@step.es a2419@dis.ulpgc.es V__)_ imodev@softhome.net osoh en jabber.at y jabber.org Usuario Linux #201634 Gentoo Linux con n�cleo 2.6.6 sobre Intel Pentium 4