From: g-3 Date: 2002-02-07T00:39:25+09:00 Subject: Re: WWW Library thanks, This was what I had in mind. # I am creating a web robot for my reseach and this really help me thanks again ganesan >[nobu.nokada@softhome.net]: >>> I am searching for a class / or sample in Ruby for getting the Host >>> name and File Paht from a url... >>> Just like the URL class in Java. >> >> URI class is contained in 1.7 standard library. > >If you want to run 1.6, you can find a simple URL parser in the Ruby >cookbook. > > http://www.rubycookbook.org/showrecipe.rb?recipeID=75 > >My module, WebFetcher, can also be used to parse http URLs: > > irb> require 'webfetcher' > irb> p = WebFetcher::Page.url('http://www.test.com:8080/a/b.html') > irb> p.port > 8080 > irb> p.host > "www.test.com" > irb> p.path > "/a/b.html" > >You find it at > > http://www.acc.umu.se/~r2d2/programming/ruby/webfetcher/ > >// Niklas -- g-3 mailto:ganesan-ml@ganekun.com