Implement Akky/.com.mx parsing. Fixes #23.

master
Sven Slootweg 10 years ago
parent ae547d0970
commit 1b60bde575

@ -98,7 +98,7 @@ grammar = {
'nserver:\s*(?P<val>[^[\s]+)',
'Name Server[.]+ (?P<val>[^[\s]+)',
'Hostname:\s*(?P<val>[^\s]+)',
'DNS[0-9]+:\s*(?P<val>.+)',
'DNS[0-9]*:\s*(?P<val>.+)',
'ns[0-9]+:\s*(?P<val>.+)',
'NS [0-9]+\s*:\s*(?P<val>.+)',
'\[Name Server\]\s*(?P<val>.+)',
@ -544,6 +544,7 @@ def parse_registrants(data, never_query_handles=True, handle_server=""):
"registrant-name:\s*(?P<name>.+)\nregistrant-type:\s*(?P<type>.+)\nregistrant-address:\s*(?P<street>.+)\nregistrant-postcode:\s*(?P<postalcode>.+)\nregistrant-city:\s*(?P<city>.+)\nregistrant-country:\s*(?P<country>.+)\n(?:registrant-phone:\s*(?P<phone>.+)\n)?(?:registrant-email:\s*(?P<email>.+)\n)?", # Hetzner
"Registrant Contact Information :[ ]*\n[ ]+(?P<firstname>.*)\n[ ]+(?P<lastname>.*)\n[ ]+(?P<organization>.*)\n[ ]+(?P<email>.*)\n[ ]+(?P<street>.*)\n[ ]+(?P<city>.*)\n[ ]+(?P<postalcode>.*)\n[ ]+(?P<phone>.*)\n[ ]+(?P<fax>.*)\n\n", # GAL Communication
"Contact Information : For Customer # [0-9]+[ ]*\n[ ]+(?P<firstname>.*)\n[ ]+(?P<lastname>.*)\n[ ]+(?P<organization>.*)\n[ ]+(?P<email>.*)\n[ ]+(?P<street>.*)\n[ ]+(?P<city>.*)\n[ ]+(?P<postalcode>.*)\n[ ]+(?P<phone>.*)\n[ ]+(?P<fax>.*)\n\n", # GAL Communication alternative (private WHOIS) format?
"Registrant:\n Name: (?P<name>.+)\n City: (?P<city>.+)\n State: (?P<state>.+)\n Country: (?P<country>.+)\n", # Akky (.com.mx)
" Registrant:\n (?P<name>.+)\n (?P<street>.+)\n (?P<city>.+) (?P<state>\S+),[ ]+(?P<postalcode>.+)\n (?P<country>.+)", # .am
"Domain Holder: (?P<organization>.+)\n(?P<street1>.+?)(?:,+ (?P<street2>.+?)(?:,+ (?P<street3>.+?)(?:,+ (?P<street4>.+?)(?:,+ (?P<street5>.+?)(?:,+ (?P<street6>.+?)(?:,+ (?P<street7>.+?))?)?)?)?)?)?, (?P<city>[^.,]+), (?P<district>.+), (?P<state>.+)\n(?P<postalcode>.+)\n(?P<country>[A-Z]+)\n", # .co.th, format 1
"Domain Holder: (?P<organization>.+)\n(?P<street1>.+?)(?:,+ (?P<street2>.+?)(?:,+ (?P<street3>.+?)(?:,+ (?P<street4>.+?)(?:,+ (?P<street5>.+?)(?:,+ (?P<street6>.+?)(?:,+ (?P<street7>.+?))?)?)?)?)?)?, (?P<city>.+)\n(?P<postalcode>.+)\n(?P<country>[A-Z]+)\n", # .co.th, format 2
@ -577,6 +578,7 @@ def parse_registrants(data, never_query_handles=True, handle_server=""):
" Technical contact:\n (?P<name>.+)\n (?P<organization>.*)\n (?P<street>.+)\n (?P<city>.+) (?P<state>\S+),[ ]+(?P<postalcode>.+)\n (?P<country>.+)\n (?P<email>.+)\n (?P<phone>.*)\n (?P<fax>.*)", # .am
"Technical:\n\s*Name:\s*(?P<name>.*)\n\s*Organisation:\s*(?P<organization>.*)\n\s*Language:.*\n\s*Phone:\s*(?P<phone>.*)\n\s*Fax:\s*(?P<fax>.*)\n\s*Email:\s*(?P<email>.*)\n", # EURid
"\[Zone-C\]\nType: (?P<type>.+)\nName: (?P<name>.+)\n(Organisation: (?P<organization>.+)\n){0,1}(Address: (?P<street1>.+)\n){1}(Address: (?P<street2>.+)\n){0,1}(Address: (?P<street3>.+)\n){0,1}(Address: (?P<street4>.+)\n){0,1}PostalCode: (?P<postalcode>.+)\nCity: (?P<city>.+)\nCountryCode: (?P<country>[A-Za-z]{2})\nPhone: (?P<phone>.+)\nFax: (?P<fax>.+)\nEmail: (?P<email>.+)\n(Remarks: (?P<remark>.+)\n){0,1}Changed: (?P<changed>.+)", # DeNIC
"Technical Contact:\n Name: (?P<name>.+)\n City: (?P<city>.+)\n State: (?P<state>.+)\n Country: (?P<country>.+)\n", # Akky (.com.mx)
"Tech Contact: (?P<handle>.+)\n(?P<organization>.+)\n(?P<street1>.+?)(?:,+ (?P<street2>.+?)(?:,+ (?P<street3>.+?)(?:,+ (?P<street4>.+?)(?:,+ (?P<street5>.+?)(?:,+ (?P<street6>.+?)(?:,+ (?P<street7>.+?))?)?)?)?)?)?\n(?P<city>.+),? (?P<state>[A-Z]{2,3})(?: [A-Z0-9]+)?\n(?P<postalcode>.+)\n(?P<country>[A-Z]+)\n", # .co.th, format 1
"Tech Contact: (?P<handle>.+)\n(?P<organization>.+)\n(?P<street1>.+?)(?:,+ (?P<street2>.+?)(?:,+ (?P<street3>.+?)(?:,+ (?P<street4>.+?)(?:,+ (?P<street5>.+?)(?:,+ (?P<street6>.+?)(?:,+ (?P<street7>.+?))?)?)?)?)?)?\n(?P<city>.+), (?P<state>.+)\n(?P<postalcode>.+)\n(?P<country>[A-Z]+)\n", # .co.th, format 2
"Tech Contact: (?P<handle>.+)\n(?P<organization>.+)\n(?P<street1>.+?)(?:,+ (?P<street2>.+?)(?:,+ (?P<street3>.+?)(?:,+ (?P<street4>.+?)(?:,+ (?P<street5>.+?)(?:,+ (?P<street6>.+?)(?:,+ (?P<street7>.+?))?)?)?)?)?)?, (?P<city>.+)\n(?P<postalcode>.+)\n(?P<country>[A-Z]+)\n", # .co.th, format 3
@ -604,6 +606,7 @@ def parse_registrants(data, never_query_handles=True, handle_server=""):
"admin-c-name:\s*(?P<name>.+)\nadmin-c-type:\s*(?P<type>.+)\nadmin-c-address:\s*(?P<street>.+)\nadmin-c-postcode:\s*(?P<postalcode>.+)\nadmin-c-city:\s*(?P<city>.+)\nadmin-c-country:\s*(?P<country>.+)\n(?:admin-c-phone:\s*(?P<phone>.+)\n)?(?:admin-c-email:\s*(?P<email>.+)\n)?", # Hetzner
"Tech Contact Information :[ ]*\n[ ]+(?P<firstname>.*)\n[ ]+(?P<lastname>.*)\n[ ]+(?P<organization>.*)\n[ ]+(?P<email>.*)\n[ ]+(?P<street>.*)\n[ ]+(?P<city>.*)\n[ ]+(?P<postalcode>.*)\n[ ]+(?P<phone>.*)\n[ ]+(?P<fax>.*)\n\n", # GAL Communication
" Administrative contact:\n (?P<name>.+)\n (?P<organization>.*)\n (?P<street>.+)\n (?P<city>.+) (?P<state>\S+),[ ]+(?P<postalcode>.+)\n (?P<country>.+)\n (?P<email>.+)\n (?P<phone>.*)\n (?P<fax>.*)", # .am
"Administrative Contact:\n Name: (?P<name>.+)\n City: (?P<city>.+)\n State: (?P<state>.+)\n Country: (?P<country>.+)\n", # Akky (.com.mx)
"\[Tech-C\]\nType: (?P<type>.+)\nName: (?P<name>.+)\n(Organisation: (?P<organization>.+)\n){0,1}(Address: (?P<street1>.+)\n){1}(Address: (?P<street2>.+)\n){0,1}(Address: (?P<street3>.+)\n){0,1}(Address: (?P<street4>.+)\n){0,1}PostalCode: (?P<postalcode>.+)\nCity: (?P<city>.+)\nCountryCode: (?P<country>[A-Za-z]{2})\nPhone: (?P<phone>.+)\nFax: (?P<fax>.+)\nEmail: (?P<email>.+)\n(Remarks: (?P<remark>.+)\n){0,1}Changed: (?P<changed>.+)", # DeNIC
]
@ -620,6 +623,7 @@ def parse_registrants(data, never_query_handles=True, handle_server=""):
"Billing Contact ID:(?P<handle>.*)\nBilling Contact Name:(?P<name>.*)\n(?:Billing Contact Organization:(?P<organization>.*)\n)?Billing Contact Address1:(?P<street1>.*)\n(?:Billing Contact Address2:(?P<street2>.*)\n)?(?:Billing Contact Address3:(?P<street3>.*)\n)?Billing Contact City:(?P<city>.*)\n(?:Billing Contact State/Province:(?P<state>.*)\n)?Billing Contact Postal Code:(?P<postalcode>.*)\nBilling Contact Country:(?P<country>.*)\nBilling Contact Country Code:.*\nBilling Contact Phone Number:(?P<phone>.*)\n(?:Billing Contact Facsimile Number:(?P<facsimile>.*)\n)?Billing Contact Email:(?P<email>.*)", # .US, .biz (NeuStar)
"Billing contact:\n(?: (?P<organization>.+)\n)? (?P<name>.+)\n (?P<email>.+)\n (?P<street>.+)\n (?P<city>.+), (?P<state>.+) (?P<postalcode>.+) (?P<country>.+)\n Phone: (?P<phone>.*)\n Fax: (?P<fax>.*)\n", # Fabulous.com
"Billing Contact Information :[ ]*\n[ ]+(?P<firstname>.*)\n[ ]+(?P<lastname>.*)\n[ ]+(?P<organization>.*)\n[ ]+(?P<email>.*)\n[ ]+(?P<street>.*)\n[ ]+(?P<city>.*)\n[ ]+(?P<postalcode>.*)\n[ ]+(?P<phone>.*)\n[ ]+(?P<fax>.*)\n\n", # GAL Communication
"Billing Contact:\n Name: (?P<name>.+)\n City: (?P<city>.+)\n State: (?P<state>.+)\n Country: (?P<country>.+)\n", # Akky (.com.mx)
]
# Some registries use NIC handle references instead of directly listing contacts...

@ -0,0 +1,91 @@
Domain Name: expopack.com.mx
Created On: 1999-10-07
Expiration Date: 2015-10-06
Last Updated On: 2011-04-09
Registrar: Akky (Una division de NIC Mexico)
URL: http://www.akky.mx
Whois TCP URI: whois.akky.mx
Whois Web URL: http://www.akky.mx/jsf/whois/whois.jsf
Registrant:
Name: EXPO PAK S.A. DE C.V.
City: Mexico
State: Distrito Federal
Country: Mexico
Administrative Contact:
Name: Alejandra Aguirre
City: Ciudad de Mexico
State: Distrito Federal
Country: Mexico
Technical Contact:
Name: Alejandra Aguirre
City: Ciudad de Mexico
State: Distrito Federal
Country: Mexico
Billing Contact:
Name: Alejandra Aguirre
City: Ciudad de Mexico
State: Distrito Federal
Country: Mexico
Name Servers:
DNS: ns1.nuestrosite.com
DNS: ns2.nuestrosite.com
% NOTICE: The expiration date displayed in this record is the date the
% registrar's sponsorship of the domain name registration in the registry is
% currently set to expire. This date does not necessarily reflect the
% expiration date of the domain name registrant's agreement with the sponsoring
% registrar. Users may consult the sponsoring registrar's Whois database to
% view the registrar's reported date of expiration for this registration.
% The requested information ("Information") is provided only for the delegation
% of domain names and the operation of the DNS administered by NIC Mexico.
% It is absolutely prohibited to use the Information for other purposes,
% including sending not requested emails for advertising or promoting products
% and services purposes (SPAM) without the authorization of the owners of the
% Information and NIC Mexico.
% The database generated from the delegation system is protected by the
% intellectual property laws and all international treaties on the matter.
% If you need more information on the records displayed here, please contact us
% by email at ayuda@nic.mx .
% If you want notify the receipt of SPAM or unauthorized access, please send a
% email to abuse@nic.mx .
% NOTA: La fecha de expiracion mostrada en esta consulta es la fecha que el
% registrar tiene contratada para el nombre de dominio en el registry. Esta
% fecha no necesariamente refleja la fecha de expiracion del nombre de dominio
% que el registrante tiene contratada con el registrar. Puede consultar la base
% de datos de Whois del registrar para ver la fecha de expiracion reportada por
% el registrar para este nombre de dominio.
% La informacion que ha solicitado se provee exclusivamente para fines
% relacionados con la delegacion de nombres de dominio y la operacion del DNS
% administrado por NIC Mexico.
% Queda absolutamente prohibido su uso para otros propositos, incluyendo el
% envio de Correos Electronicos no solicitados con fines publicitarios o de
% promocion de productos y servicios (SPAM) sin mediar la autorizacion de los
% afectados y de NIC Mexico.
% La base de datos generada a partir del sistema de delegacion, esta protegida
% por las leyes de Propiedad Intelectual y todos los tratados internacionales
% sobre la materia.
% Si necesita mayor informacion sobre los registros aqui mostrados, favor de
% comunicarse a ayuda@nic.mx.
% Si desea notificar sobre correo no solicitado o accesos no autorizados, favor
% de enviar su mensaje a abuse@nic.mx.

@ -0,0 +1 @@
{"updated_date": ["2011-04-09T00:00:00"], "contacts": {"admin": {"city": "Ciudad de Mexico", "state": "Distrito Federal", "name": "Alejandra Aguirre", "country": "Mexico"}, "tech": {"city": "Ciudad de Mexico", "state": "Distrito Federal", "name": "Alejandra Aguirre", "country": "Mexico"}, "registrant": {"city": "Mexico", "state": "Distrito Federal", "name": "EXPO PAK S.A. DE C.V.", "country": "Mexico"}, "billing": {"city": "Ciudad de Mexico", "state": "Distrito Federal", "name": "Alejandra Aguirre", "country": "Mexico"}}, "nameservers": ["ns1.nuestrosite.com", "ns2.nuestrosite.com"], "expiration_date": ["2015-10-06T00:00:00"], "creation_date": ["1999-10-07T00:00:00", "1999-10-07T00:00:00"], "raw": ["\nDomain Name: expopack.com.mx\n\nCreated On: 1999-10-07\nExpiration Date: 2015-10-06\nLast Updated On: 2011-04-09\nRegistrar: Akky (Una division de NIC Mexico)\nURL: http://www.akky.mx\nWhois TCP URI: whois.akky.mx\nWhois Web URL: http://www.akky.mx/jsf/whois/whois.jsf\n\nRegistrant:\n Name: EXPO PAK S.A. DE C.V.\n City: Mexico\n State: Distrito Federal\n Country: Mexico\n\nAdministrative Contact:\n Name: Alejandra Aguirre\n City: Ciudad de Mexico\n State: Distrito Federal\n Country: Mexico\n\nTechnical Contact:\n Name: Alejandra Aguirre\n City: Ciudad de Mexico\n State: Distrito Federal\n Country: Mexico\n\nBilling Contact:\n Name: Alejandra Aguirre\n City: Ciudad de Mexico\n State: Distrito Federal\n Country: Mexico\n\nName Servers:\n DNS: ns1.nuestrosite.com \n DNS: ns2.nuestrosite.com \n\n\n% NOTICE: The expiration date displayed in this record is the date the\n% registrar's sponsorship of the domain name registration in the registry is\n% currently set to expire. This date does not necessarily reflect the\n% expiration date of the domain name registrant's agreement with the sponsoring\n% registrar. Users may consult the sponsoring registrar's Whois database to\n% view the registrar's reported date of expiration for this registration.\n\n% The requested information (\"Information\") is provided only for the delegation\n% of domain names and the operation of the DNS administered by NIC Mexico.\n\n% It is absolutely prohibited to use the Information for other purposes, \n% including sending not requested emails for advertising or promoting products\n% and services purposes (SPAM) without the authorization of the owners of the\n% Information and NIC Mexico.\n\n% The database generated from the delegation system is protected by the\n% intellectual property laws and all international treaties on the matter.\n\n% If you need more information on the records displayed here, please contact us\n% by email at ayuda@nic.mx .\n\n% If you want notify the receipt of SPAM or unauthorized access, please send a\n% email to abuse@nic.mx .\n\n% NOTA: La fecha de expiracion mostrada en esta consulta es la fecha que el\n% registrar tiene contratada para el nombre de dominio en el registry. Esta\n% fecha no necesariamente refleja la fecha de expiracion del nombre de dominio\n% que el registrante tiene contratada con el registrar. Puede consultar la base\n% de datos de Whois del registrar para ver la fecha de expiracion reportada por\n% el registrar para este nombre de dominio.\n\n% La informacion que ha solicitado se provee exclusivamente para fines\n% relacionados con la delegacion de nombres de dominio y la operacion del DNS\n% administrado por NIC Mexico.\n\n% Queda absolutamente prohibido su uso para otros propositos, incluyendo el\n% envio de Correos Electronicos no solicitados con fines publicitarios o de\n% promocion de productos y servicios (SPAM) sin mediar la autorizacion de los\n% afectados y de NIC Mexico.\n\n% La base de datos generada a partir del sistema de delegacion, esta protegida\n% por las leyes de Propiedad Intelectual y todos los tratados internacionales\n% sobre la materia.\n\n% Si necesita mayor informacion sobre los registros aqui mostrados, favor de\n% comunicarse a ayuda@nic.mx.\n\n% Si desea notificar sobre correo no solicitado o accesos no autorizados, favor\n% de enviar su mensaje a abuse@nic.mx.\n\n\n"], "registrar": ["Akky (Una division de NIC Mexico)"], "emails": ["ayuda@nic.mx", "abuse@nic.mx"]}

@ -0,0 +1 @@
{"updated_date": ["2011-04-09T00:00:00"], "contacts": {"admin": {"city": "Ciudad de Mexico", "state": "Distrito Federal", "name": "Alejandra Aguirre", "country": "Mexico"}, "tech": {"city": "Ciudad de Mexico", "state": "Distrito Federal", "name": "Alejandra Aguirre", "country": "Mexico"}, "registrant": {"city": "Mexico", "state": "Distrito Federal", "name": "Expo Pak S.A. DE C.V.", "country": "Mexico"}, "billing": {"city": "Ciudad de Mexico", "state": "Distrito Federal", "name": "Alejandra Aguirre", "country": "Mexico"}}, "nameservers": ["ns1.nuestrosite.com", "ns2.nuestrosite.com"], "expiration_date": ["2015-10-06T00:00:00"], "creation_date": ["1999-10-07T00:00:00", "1999-10-07T00:00:00"], "raw": ["\nDomain Name: expopack.com.mx\n\nCreated On: 1999-10-07\nExpiration Date: 2015-10-06\nLast Updated On: 2011-04-09\nRegistrar: Akky (Una division de NIC Mexico)\nURL: http://www.akky.mx\nWhois TCP URI: whois.akky.mx\nWhois Web URL: http://www.akky.mx/jsf/whois/whois.jsf\n\nRegistrant:\n Name: EXPO PAK S.A. DE C.V.\n City: Mexico\n State: Distrito Federal\n Country: Mexico\n\nAdministrative Contact:\n Name: Alejandra Aguirre\n City: Ciudad de Mexico\n State: Distrito Federal\n Country: Mexico\n\nTechnical Contact:\n Name: Alejandra Aguirre\n City: Ciudad de Mexico\n State: Distrito Federal\n Country: Mexico\n\nBilling Contact:\n Name: Alejandra Aguirre\n City: Ciudad de Mexico\n State: Distrito Federal\n Country: Mexico\n\nName Servers:\n DNS: ns1.nuestrosite.com \n DNS: ns2.nuestrosite.com \n\n\n% NOTICE: The expiration date displayed in this record is the date the\n% registrar's sponsorship of the domain name registration in the registry is\n% currently set to expire. This date does not necessarily reflect the\n% expiration date of the domain name registrant's agreement with the sponsoring\n% registrar. Users may consult the sponsoring registrar's Whois database to\n% view the registrar's reported date of expiration for this registration.\n\n% The requested information (\"Information\") is provided only for the delegation\n% of domain names and the operation of the DNS administered by NIC Mexico.\n\n% It is absolutely prohibited to use the Information for other purposes, \n% including sending not requested emails for advertising or promoting products\n% and services purposes (SPAM) without the authorization of the owners of the\n% Information and NIC Mexico.\n\n% The database generated from the delegation system is protected by the\n% intellectual property laws and all international treaties on the matter.\n\n% If you need more information on the records displayed here, please contact us\n% by email at ayuda@nic.mx .\n\n% If you want notify the receipt of SPAM or unauthorized access, please send a\n% email to abuse@nic.mx .\n\n% NOTA: La fecha de expiracion mostrada en esta consulta es la fecha que el\n% registrar tiene contratada para el nombre de dominio en el registry. Esta\n% fecha no necesariamente refleja la fecha de expiracion del nombre de dominio\n% que el registrante tiene contratada con el registrar. Puede consultar la base\n% de datos de Whois del registrar para ver la fecha de expiracion reportada por\n% el registrar para este nombre de dominio.\n\n% La informacion que ha solicitado se provee exclusivamente para fines\n% relacionados con la delegacion de nombres de dominio y la operacion del DNS\n% administrado por NIC Mexico.\n\n% Queda absolutamente prohibido su uso para otros propositos, incluyendo el\n% envio de Correos Electronicos no solicitados con fines publicitarios o de\n% promocion de productos y servicios (SPAM) sin mediar la autorizacion de los\n% afectados y de NIC Mexico.\n\n% La base de datos generada a partir del sistema de delegacion, esta protegida\n% por las leyes de Propiedad Intelectual y todos los tratados internacionales\n% sobre la materia.\n\n% Si necesita mayor informacion sobre los registros aqui mostrados, favor de\n% comunicarse a ayuda@nic.mx.\n\n% Si desea notificar sobre correo no solicitado o accesos no autorizados, favor\n% de enviar su mensaje a abuse@nic.mx.\n\n\n"], "registrar": ["Akky (Una division de NIC Mexico)"], "emails": ["ayuda@nic.mx", "abuse@nic.mx"]}
Loading…
Cancel
Save