From 11e10b2e86a11adadb1678c3dffb545071b85247 Mon Sep 17 00:00:00 2001 From: Larry Kim Date: Mon, 11 Feb 2013 17:53:19 +0900 Subject: [PATCH] .net support. Add test feature in parser.py. --- whois/parser.py | 4 +++- whois/tlds/net | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/whois/parser.py b/whois/parser.py index 7a2ee22..60bceeb 100644 --- a/whois/parser.py +++ b/whois/parser.py @@ -70,11 +70,13 @@ class Parser(object): except: self.parseConf = self.parseDefaultConf.get("default") - def run(self): + def run(self, TEST=False): result = {} for key in self.parseConf: matches = re.findall(self.parseConf[key], self.text, re.MULTILINE) if matches: result.update({key: map(lambda x: x.strip(), matches)}) + if TEST and not matches: print "No match for %s"%(key) + print result diff --git a/whois/tlds/net b/whois/tlds/net index 633e2ab..2b31077 100644 --- a/whois/tlds/net +++ b/whois/tlds/net @@ -1,11 +1,18 @@ server = { "host": "net.whois-servers.net", - "redirect": ".*Whois Server: (.*)", + "redirect": "\s+Whois Server: (.*)", } parse = { "default": { - + "NotFound": "No match for domain", + "DomainName": "Domain Name:\s+(.+)", + "Registrar": "Registrar:\s+(.+)", + "NameServer": "Name Server:\s+(.+)", + "Status": "Status:\s+(.+)", + "UpdatedDate": "Updated Date:\s+(.+)", + "CreationDate": "Creation Date:\s+(.+)", + "ExpirationDate": "Expiration Date:\s+(.+)", }, "whois.dotname.co.kr": {