Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing parse to work for .io domains [+test data for github.io] #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pythonwhois/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def preprocess_regex(regex):
"Registrant:\n registrant_org: (?P<organization>.*)\n registrant_name: (?P<name>.*)\n registrant_email: (?P<email>.*)\n registrant_address: (?P<address>.*)\n registrant_city: (?P<city>.*)\n registrant_state: (?P<state>.*)\n registrant_zip: (?P<postalcode>.*)\n registrant_country: (?P<country>.*)\n registrant_phone: (?P<phone>.*)", # Bellnames
"Holder of domain name:\n(?P<name>[\S\s]+)\n(?P<street>.+)\n(?P<postalcode>[A-Z0-9-]+)\s+(?P<city>.+)\n(?P<country>.+)\nContractual Language", # nic.ch
"\n\n(?:Owner)?\s+: (?P<name>.*)\n(?:\s+: (?P<organization>.*)\n)?\s+: (?P<street>.*)\n\s+: (?P<city>.*)\n\s+: (?P<state>.*)\n\s+: (?P<country>.*)\n", # nic.io
"\n\n(?:Owner)?\s+: (?P<name>.*)\n(?:Owner)?(?:\s+: (?P<organization>.*)\n)(?:Owner)??\s+: (?P<street>.*)\n(?:Owner)?\s+: (?P<city>.*)\n(?:Owner)?\s+: (?P<state>.*)\n(?:Owner)?\s+: (?P<country>.*)\n", # nic.io format with multiple Owner:
"Contact Information:\n\[Name\]\s*(?P<name>.*)\n\[Email\]\s*(?P<email>.*)\n\[Web Page\]\s*(?P<url>.*)\n\[Postal code\]\s*(?P<postalcode>.*)\n\[Postal Address\]\s*(?P<street1>.*)\n(?:\s+(?P<street2>.*)\n)?(?:\s+(?P<street3>.*)\n)?\[Phone\]\s*(?P<phone>.*)\n\[Fax\]\s*(?P<fax>.*)\n", # jprs.jp
"g\. \[Organization\] (?P<organization>.+)\n", # .co.jp registrations at jprs.jp
"Registrant ID:(?P<handle>.*)\nRegistrant Name:(?P<name>.*)\n(?:Registrant Organization:(?P<organization>.*)\n)?Registrant Address1:(?P<street1>.*)\n(?:Registrant Address2:(?P<street2>.*)\n)?(?:Registrant Address3:(?P<street3>.*)\n)?Registrant City:(?P<city>.*)\n(?:Registrant State/Province:(?P<state>.*)\n)?(?:Registrant Postal Code:(?P<postalcode>.*)\n)?Registrant Country:(?P<country>.*)\nRegistrant Country Code:.*\nRegistrant Phone Number:(?P<phone>.*)\n(?:Registrant Facsimile Number:(?P<facsimile>.*)\n)?Registrant Email:(?P<email>.*)", # .US, .biz (NeuStar), .buzz, .moe (Interlink Co. Ltd.)
Expand Down
14 changes: 14 additions & 0 deletions test/data/github.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Status : Client Updt Lock
Expiration date : 2016-03-08 00:00:00
Name server : ns1.p16.dynect.net
Name server : ns2.p16.dynect.net
Name server : ns3.p16.dynect.net
Name server : ns4.p16.dynect.net

Registrant
Name : Domain Administrator
Organization : GitHub, Inc.
Street address : 548 4th Street
City : San Francisco
State / Province : California
Country : United States
1 change: 1 addition & 0 deletions test/target_default/github.io
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"status": ["Client Updt Lock"], "expiration_date": ["2016-03-08T00:00:00"], "raw": ["Status : Client Updt Lock\nExpiration date : 2016-03-08 00:00:00\nName server : ns1.p16.dynect.net\nName server : ns2.p16.dynect.net\nName server : ns3.p16.dynect.net\nName server : ns4.p16.dynect.net\n\nRegistrant\n Name : Domain Administrator\n Organization : GitHub, Inc.\n Street address : 548 4th Street\n City : San Francisco\n State / Province : California\n Country : United States\n"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}}
1 change: 1 addition & 0 deletions test/target_normalized/github.io
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"status": ["Client Updt Lock"], "expiration_date": ["2016-03-08T00:00:00"], "raw": ["Status : Client Updt Lock\nExpiration date : 2016-03-08 00:00:00\nName server : ns1.p16.dynect.net\nName server : ns2.p16.dynect.net\nName server : ns3.p16.dynect.net\nName server : ns4.p16.dynect.net\n\nRegistrant\n Name : Domain Administrator\n Organization : GitHub, Inc.\n Street address : 548 4th Street\n City : San Francisco\n State / Province : California\n Country : United States\n"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}}