Details |
Last modification |
View Log
| RSS feed
Rev |
Author |
Line No. |
Line |
40 |
7u83 |
1 |
publicsuffix_erlang
|
|
|
2 |
===================
|
|
|
3 |
|
|
|
4 |
This repository contains Perl script and ready to use Erlang module.
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
Information
|
|
|
9 |
-----------
|
|
|
10 |
|
|
|
11 |
Perl script can be used to generate up-to-date module from ruleset:
|
|
|
12 |
http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1
|
|
|
13 |
|
|
|
14 |
http://publicsuffix.org/learn/
|
|
|
15 |
|
|
|
16 |
If you don't want to generate Erlang module yourself, feel free to use one from the repository.
|
|
|
17 |
|
|
|
18 |
Usage
|
|
|
19 |
-----
|
|
|
20 |
|
|
|
21 |
To get domain part:
|
|
|
22 |
|
|
|
23 |
publicsuffix:domain("www.google.co.uk"). %% google.co.uk
|
|
|
24 |
|
|
|
25 |
To get public suffix:
|
|
|
26 |
|
|
|
27 |
publicsuffix:suffix("www.google.co.uk"). %% co.uk
|