On 9/5/06, Gustav - Railist <gustav / rails.co.za> wrote: > Hey! > > Can anybody tell me if there's a way to find what the domain of a url is ? > I was thinking somehow using Net::HTTP? > > e.g. > > del.icio.us => icio.us > -or- > mrboulder.blogspot.com => blogspot.com > > Thanks! > > Gustav Look at URI it it does something for you. Anyway, the question is more complicated than it seems (take 4 level domains for example). Basically url.split('.')[1..-1] could make it.