add .at
authorhex2a
Fri, 06 May 2016 13:49:35 +0000
changeset 87 0f12faf57d33
parent 82 fc40924ac59b
child 88 124331d7ca1e
add .at
whois/parser.py
--- a/whois/parser.py	Thu Mar 17 15:37:34 2016 +0100
+++ b/whois/parser.py	Fri May 06 13:49:35 2016 +0000
@@ -204,6 +204,8 @@
             return WhoisBg(domain, text)
         elif domain.endswith('.de'):
             return WhoisDe(domain, text)
+        elif domain.endswith('.at'):
+            return WhoisAt(domain, text)
         elif domain.endswith('.ca'):
             return WhoisCa(domain, text)
         elif domain.endswith('.be'):
@@ -771,6 +773,26 @@
         else:
             WhoisEntry.__init__(self, domain, text, self.regex)
 
+class WhoisAt(WhoisEntry):
+    """Whois parser for .at domains
+    """
+    regex = {
+        'name': 'personname: *(.+)',
+        'org': 'organization: *(.+)',
+        'address': 'street address: *(.+)',
+        'zipcode': 'postal code: *(.+)',
+        'city': 'city: *(.+)',
+        'country': 'country: *(.+)',
+        'phone': 'Phone: *(.+)',
+        'fax': 'Fax: *(.+)',
+        'changed': 'changed: *(.+)',
+    }
+
+    def __init__(self, domain, text):
+        if 'Status: free' in text:
+            raise PywhoisError(text)
+        else:
+            WhoisEntry.__init__(self, domain, text, self.regex)
 
 class WhoisBe(WhoisEntry):
     """Whois parser for .be domains