From: Charles Calvert Date: 2010-08-24T00:55:39+09:00 Subject: Re: Extract domain name On Sun, 22 Aug 2010 22:35:31 -0500, Michael Fellinger wrote in : >On Mon, Aug 23, 2010 at 10:40 AM, Charles Calvert wrote: >> On Fri, 20 Aug 2010 01:02:56 -0500, Mr zengr >> wrote in : >> >> [snip my question about extracting domain name (e.g. "example.com" >> from "www.example.com"). >>> >>>I think the best way will be actually match with a list of TLDs and >>>gTLDs. [snip] >http://github.com/pauldix/domainatrix For a minute, I thought your reply was generated by a porn spam bot until I saw github in the URL. :) For those reading the thread, this is a gem that uses http://publicsuffix.org/ to parse domain names and identify the suffix (e.g. "com" or "co.uk"), domain, subdomains, etc. It extends Addressable.URI. That was very helpful. Thanks. -- Charles Calvert Moderator - alt.computer.consultants.moderated Submission Address: accm@celticwolf.net Contact Address: accm_mod@celticwolf.net