# HG changeset patch # User Richard Baron Penman # Date 1357622854 -39600 # Node ID 169462701583d29131739877063414d79af973ed # Parent 6d18568e986de7c805d9f2da3dcf07d8fd931530 added support for org.uk diff -r 6d18568e986d -r 169462701583 pywhois/__init__.py --- a/pywhois/__init__.py Tue Jan 08 16:21:26 2013 +1100 +++ b/pywhois/__init__.py Tue Jan 08 16:27:34 2013 +1100 @@ -17,6 +17,7 @@ # try experimental client nic_client = NICClient() text = nic_client.whois_lookup(None, domain, 0) + print text return WhoisEntry.load(domain, text) diff -r 6d18568e986d -r 169462701583 pywhois/parser.py --- a/pywhois/parser.py Tue Jan 08 16:21:26 2013 +1100 +++ b/pywhois/parser.py Tue Jan 08 16:27:34 2013 +1100 @@ -94,27 +94,27 @@ if text.strip() == 'No whois server is known for this kind of object.': raise PywhoisError(text) - if '.com' in domain: + if domain.endswith('.com'): return WhoisCom(domain, text) - elif '.net' in domain: + elif domain.endswith('.net'): return WhoisNet(domain, text) - elif '.org' in domain: + elif domain.endswith('.org'): return WhoisOrg(domain, text) - elif '.ru' in domain: - return WhoisRu(domain, text) - elif '.name' in domain: + elif domain.endswith('.name'): return WhoisName(domain, text) - elif '.us' in domain: + elif domain.endswith('.me'): + return WhoisMe(domain, text) + elif domain.endswith('.ru'): + return WhoisRu(domain, text) + elif domain.endswith('.us'): return WhoisUs(domain, text) - elif '.me' in domain: - return WhoisMe(domain, text) - elif '.uk' in domain: + elif domain.endswith('.uk'): return WhoisUk(domain, text) - elif '.fr' in domain: + elif domain.endswith('.fr'): return WhoisFr(domain, text) - elif '.fi' in domain: + elif domain.endswith('.fi'): return WhoisFi(domain, text) - elif '.jp' in domain: + elif domain.endswith('.jp'): return WhoisJp(domain, text) else: return WhoisEntry(domain, text)