Add Slovak TLD (.sk) domain support
authorPeter Gonda <peter@pipoline.com>
Thu, 05 Jan 2017 17:14:47 +0100
changeset 117 32947b10adce
parent 116 fff9472eb920
child 118 d024d2328e51
child 119 3c7fbec18337
Add Slovak TLD (.sk) domain support
whois/parser.py
--- a/whois/parser.py	Wed Dec 21 12:20:21 2016 +0800
+++ b/whois/parser.py	Thu Jan 05 17:14:47 2017 +0100
@@ -239,6 +239,8 @@
             return WhoisChLi(domain, text)
         elif domain.endswith('.id'):
             return WhoisID(domain, text)
+        elif domain.endswith('.sk'):
+            return WhoisSK(domain, text)
         else:
             return WhoisEntry(domain, text)
 
@@ -1064,6 +1066,7 @@
         else:
             WhoisEntry.__init__(self, domain, text, self.regex)
 
+
 class WhoisID(WhoisEntry):
         """Whois parser for .id domains
         """
@@ -1094,3 +1097,36 @@
                 raise PywhoisError(text)
             else:
                 WhoisEntry.__init__(self, domain, text, self.regex)
+
+
+class WhoisSK(WhoisEntry):
+        """
+        Whois parser for .sk domains
+         """
+        regex = {
+            'domain_name':                  'Domain-name *(.+)',
+            'expiration_date':              'Valid-date *(.+)',
+            'status':                       'Domain-status *(.+)',
+            'name_servers':                 'dns_name *(.+)',
+            'tech_id':                      'Tech-id *(.+)',
+            'tech_name':                    'Tech-name *(.+)',
+            'tech_org_id':                  'Tech-org.-ID *(.+)',
+            'tech_address':                 'Tech-address *(.+)',
+            'tech_email':                   'Tech-email *(.+)',
+            'admin_id':                     'Admin-id *(.+)',
+            'admin_name':                   'Admin-name *(.+)',
+            'admin_legal_form':             'Admin-legal-form (.+)',
+            'admin_org_id':                 'Admin-org.-ID *(.+)',
+            'admin_address':                'Admin-address *(.+)',
+            'admin_email':                  'Admin-email *(.+)',
+            'updated_date':                 'Last-update *(.+)',
+            'tech_phone':                   'Tech-telephone *(.+)',
+            'name_servers_ipv4':            'dns_IPv4 *(.+)',
+
+        }
+
+        def __init__(self, domain, text):
+            if 'NOT FOUND' in text:
+                raise PywhoisError(text)
+            else:
+                WhoisEntry.__init__(self, domain, text, self.regex)