Projects / libtld

libtld

libtld is a library used to extract the TLD from a URI. This allows you to extract the exact domain name, sub-domains, and all the TLD (top level, second level, third level, etc.). The problem with TLDs is that you cannot know where the domain starts. Some domains can use one top-level domain, others use two, etc. However, it may be useful to know where the domain is to have the exact list of sub-domains. For example, if you want to force www. at the start of the domain name if no other sub-domains are specified, then you need to know exactly how many TLD are defined in a URI. The libtld offers one function: tld(), which gives you a way to extract the TLD from any URI. The result is the offset where the TLD starts. This gives you enough information to extract everything else you need.

Tags
Licenses
Operating Systems
Implementation
Translations

RSS Recent releases

  •  18 Feb 2013 04:27

Release Notes: This release adds a C++ class to easily handle URIs in C++, adds a PHP extension so [check_]tld() can be used in PHP, adds a static version of the library, updates the TLDs as of Feb 2013, and fixes the TLD exceptions, which now return a valid answer.

  •  07 May 2012 22:51

Release Notes: Support for exceptions such as nic.uk. The tests have been update accordingly. A test for the XML file to make sure it respects the DTD has been added. This release fixes offsets in the data table, unsigned short and -1; it uses USHRT_MAX now. The .us entries are complete.

  •  18 Dec 2011 17:01

Release Notes: This release adds many TLDs as defined by the Public Suffix List. It has a new test to check data against the Public Suffix List. The existing tests have been updated to work with the new library. There is a new category called Entrepreneurial (i.e. official domain names used to resale sub-domains; i.e. .uk.com.)

  •  26 Nov 2011 01:50

    Release Notes: Initial freecode announcement.

    Screenshot

    Project Spotlight

    VMIPS

    MIPS R3000 simulator

    Screenshot

    Project Spotlight

    codecrypt

    A post-quantum cryptography tool.