whois/parser.py
changeset 117 32947b10adce
parent 116 fff9472eb920
child 118 d024d2328e51
child 119 3c7fbec18337
equal deleted inserted replaced
116:fff9472eb920 117:32947b10adce
   237             return WhoisChLi(domain, text)
   237             return WhoisChLi(domain, text)
   238         elif domain.endswith('.li'):
   238         elif domain.endswith('.li'):
   239             return WhoisChLi(domain, text)
   239             return WhoisChLi(domain, text)
   240         elif domain.endswith('.id'):
   240         elif domain.endswith('.id'):
   241             return WhoisID(domain, text)
   241             return WhoisID(domain, text)
       
   242         elif domain.endswith('.sk'):
       
   243             return WhoisSK(domain, text)
   242         else:
   244         else:
   243             return WhoisEntry(domain, text)
   245             return WhoisEntry(domain, text)
   244 
   246 
   245 
   247 
   246 class WhoisCom(WhoisEntry):
   248 class WhoisCom(WhoisEntry):
  1062         if 'We do not have an entry in our database matching your query.' in text:
  1064         if 'We do not have an entry in our database matching your query.' in text:
  1063             raise PywhoisError(text)
  1065             raise PywhoisError(text)
  1064         else:
  1066         else:
  1065             WhoisEntry.__init__(self, domain, text, self.regex)
  1067             WhoisEntry.__init__(self, domain, text, self.regex)
  1066 
  1068 
       
  1069 
  1067 class WhoisID(WhoisEntry):
  1070 class WhoisID(WhoisEntry):
  1068         """Whois parser for .id domains
  1071         """Whois parser for .id domains
  1069         """
  1072         """
  1070         regex = {
  1073         regex = {
  1071             'domain_id':                   'Domain ID:(.+)',
  1074             'domain_id':                   'Domain ID:(.+)',
  1092         def __init__(self, domain, text):
  1095         def __init__(self, domain, text):
  1093             if 'NOT FOUND' in text:
  1096             if 'NOT FOUND' in text:
  1094                 raise PywhoisError(text)
  1097                 raise PywhoisError(text)
  1095             else:
  1098             else:
  1096                 WhoisEntry.__init__(self, domain, text, self.regex)
  1099                 WhoisEntry.__init__(self, domain, text, self.regex)
       
  1100 
       
  1101 
       
  1102 class WhoisSK(WhoisEntry):
       
  1103         """
       
  1104         Whois parser for .sk domains
       
  1105          """
       
  1106         regex = {
       
  1107             'domain_name':                  'Domain-name *(.+)',
       
  1108             'expiration_date':              'Valid-date *(.+)',
       
  1109             'status':                       'Domain-status *(.+)',
       
  1110             'name_servers':                 'dns_name *(.+)',
       
  1111             'tech_id':                      'Tech-id *(.+)',
       
  1112             'tech_name':                    'Tech-name *(.+)',
       
  1113             'tech_org_id':                  'Tech-org.-ID *(.+)',
       
  1114             'tech_address':                 'Tech-address *(.+)',
       
  1115             'tech_email':                   'Tech-email *(.+)',
       
  1116             'admin_id':                     'Admin-id *(.+)',
       
  1117             'admin_name':                   'Admin-name *(.+)',
       
  1118             'admin_legal_form':             'Admin-legal-form (.+)',
       
  1119             'admin_org_id':                 'Admin-org.-ID *(.+)',
       
  1120             'admin_address':                'Admin-address *(.+)',
       
  1121             'admin_email':                  'Admin-email *(.+)',
       
  1122             'updated_date':                 'Last-update *(.+)',
       
  1123             'tech_phone':                   'Tech-telephone *(.+)',
       
  1124             'name_servers_ipv4':            'dns_IPv4 *(.+)',
       
  1125 
       
  1126         }
       
  1127 
       
  1128         def __init__(self, domain, text):
       
  1129             if 'NOT FOUND' in text:
       
  1130                 raise PywhoisError(text)
       
  1131             else:
       
  1132                 WhoisEntry.__init__(self, domain, text, self.regex)