pike.git
/
lib
/
modules
/
Standards.pmod
/
TLD.pmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Standards.pmod/TLD.pmod:1:
// By Martin Nilsson
-
// Updated
2008
-
12
-
28
from http://www.iana.org/domains/root/db/
+
// Updated
2017
-
03
-
05
from http://www.iana.org/domains/root/db/
#pike __REAL_VERSION__ //! A mapping between country TLDs and the name of the country. constant cc = ([ "ac": "Ascension Island", "ad": "Andorra", "ae": "United Arab Emirates", "af": "Afghanistan", "ag": "Antigua and Barbuda",
pike.git/lib/modules/Standards.pmod/TLD.pmod:53:
"ci": "Cote d'Ivoire", "ck": "Cook Islands", "cl": "Chile", "cm": "Cameroon", "cn": "China", "co": "Colombia", "cr": "Costa Rica", "cs": "Serbia and Montenegro", // Deprecated "cu": "Cuba", "cv": "Cape Verde",
+
"cw": "Curacao",
"cx": "Christmas Island", "cy": "Cyprus", "cz": "Czech Republic", "de": "Germany", "dj": "Djibouti", "dk": "Denmark", "dm": "Dominica", "do": "Dominican Republic", "dz": "Algeria", "ec": "Ecuador",
pike.git/lib/modules/Standards.pmod/TLD.pmod:209:
"sh": "Saint Helena", "si": "Slovenia", "sj": "Svalbard and Jan Mayen Islands", "sk": "Slovak Republic", "sl": "Sierra Leone", "sm": "San Marino", "sn": "Senegal", "so": "Somalia", "sr": "Suriname", "st": "Sao Tome and Principe",
-
"su": "Soviet Union", // Deprecated
+
"su": "Soviet Union", // Deprecated
// Revived...
"sv": "El Salvador", "sy": "Syrian Arab Republic",
-
+
"sx": "Sint Maarten",
"sz": "Swaziland", "tc": "Turks and Caicos Islands", "td": "Chad", "tf": "French Southern Territories", "tg": "Togo", "th": "Thailand", "tj": "Tajikistan", "tk": "Tokelau", "tl": "Timor-Leste", "tm": "Turkmenistan",
pike.git/lib/modules/Standards.pmod/TLD.pmod:248:
"vc": "Saint Vincent and the Grenadines", "ve": "Venezuela", "vg": "Virgin Islands, British", "vi": "Virgin Islands, U.S.", "vn": "Vietnam", "vu": "Vanuatu", "wf": "Wallis and Futuna Islands", "ws": "Samoa", "ye": "Yemen", "yt": "Mayotte",
-
"yu": "Yugoslavia",
+
"yu": "Yugoslavia",
// Deprecated
"za": "South Africa", "zm": "Zambia", "zw": "Zimbabwe" ]); //! A multiset containing the generic TLDs, such as "com" and "info". multiset generic = (< "aero", "arpa", "asia",
pike.git/lib/modules/Standards.pmod/TLD.pmod:278:
"mil", "mobi", "museum", "name", "net", "org", "pro", "tel", "travel", >);
+
+
#ifdef UPDATE
+
void main()
+
{
+
multiset new_generic = (<>);
+
mapping new_cctld = ([]);
+
string page = Protocols.HTTP.get_url_nice("http://www.iana.org/domains/root/db")[1];
+
Parser.HTML p = Parser.HTML();
+
array tds = ({});
+
p->add_tag("tr") {
+
tds = ({});
+
};
+
p->add_container("td", lambda(Parser.HTML p, mapping m, string c)
+
{
+
tds += ({ c });
+
if( sizeof(tds)==3 )
+
{
+
sscanf(tds[0], "%*s>.%s<", tds[0]);
+
sscanf(tds[0], "%*s>‏.%sÈe;<", tds[0]);
+
+
switch(tds[1])
+
{
+
case "generic":
+
new_generic[tds[0]]=1;
+
break;
+
case "country-code":
+
new_cctld[tds[0]]=tds[2];
+
break;
+
}
+
}
+
});
+
p->finish(page);
+
+
// foreach(new_cctld; string domain;)
+
// if(!cc[domain]) write("Missing cctld %O\n", domain);
+
// foreach(cc; string domain;)
+
// if(!new_cctld[domain]) write("Removed cctld %O\n", domain);
+
// foreach(new_generic; string domain;)
+
// if(!generic[domain]) write("Missing generic %O\n", domain);
+
}
+
#endif