From 9f25580fd55017939330211aad4242b095ee9dbf Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Fri, 21 Sep 2012 05:03:46 +0200 Subject: [PATCH] Add parsing syntax for EDU domains --- pythonwhois/__init__.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pythonwhois/__init__.py b/pythonwhois/__init__.py index 8ae34e6..f4380f2 100644 --- a/pythonwhois/__init__.py +++ b/pythonwhois/__init__.py @@ -19,18 +19,21 @@ grammar = { 'Created on\s?[.]*:\s?(?P.+)\.', 'Date Registered\s?[.]*:\s?(?P.+)', 'Domain Created\s?[.]*:\s?(?P.+)', - 'Domain registered\s?[.]*:\s?(?P.+)'], + 'Domain registered\s?[.]*:\s?(?P.+)', + 'Domain record activated\s?[.]*:\s*?(?P.+)'], 'expiration_date': ['Expires on:\s?(?P.+)', 'Expires on\s?[.]*:\s?(?P.+)\.', 'Expiry Date\s?[.]*:\s?(?P.+)', 'Domain Currently Expires\s?[.]*:\s?(?P.+)', - 'Record will expire on\s?[.]*:\s?(?P.+)'], + 'Record will expire on\s?[.]*:\s?(?P.+)', + 'Domain expires\s?[.]*:\s*?(?P.+)'], 'registrar': ['Registered through:\s?(?P.+)', 'Registrar Name:\s?(?P.+)', 'Record maintained by:\s?(?P.+)'], 'whois_server': ['Registrar Whois:\s?(?P.+)'], 'name_servers': ['(?Pd?ns[0-9]+\.[a-z0-9-]+\.[a-z0-9]+)', - '(?P[a-z0-9-]+\.d?ns[0-9]*\.[a-z0-9-]+\.[a-z0-9]+)'], + '(?P[a-z0-9-]+\.d?ns[0-9]*\.[a-z0-9-]+\.[a-z0-9]+)', + '(?P([a-z0-9-]+\.)+[a-z0-9]+)(\s+([0-9]{1,3}\.){3}[0-9]{1,3})'], 'emails': ['(?P[\w.-]+@[\w.-]+\.[\w]{2,4})'] }, "_dateformats": ( @@ -164,16 +167,22 @@ def parse_dates(dates): hour = int(result.group("hour")) except IndexError, e: hour = 0 + except TypeError, e: + hour = 0 try: minute = int(result.group("minute")) except IndexError, e: minute = 0 + except TypeError, e: + minute = 0 try: second = int(result.group("second")) except IndexError, e: second = 0 + except TypeError, e: + second = 0 break except ValueError, e: