.jp support

This commit is contained in:
Larry Kim 2013-05-21 20:50:54 +09:00
parent f8bf366495
commit f82199192b
2 changed files with 52 additions and 4 deletions

View File

@ -6,15 +6,15 @@ The whois library, which is developed in Python language, retrieves domain infor
Quick start Quick start
----------- -----------
Install the library Install the library.
python setup.py install python setup.py install
Run Python interpreter Run Python interpreter.
python python
To get whois data of example.com To get whois data of example.com,
import whois import whois
whoisData = whois.whois("example.com").query() whoisData = whois.whois("example.com").query()
@ -23,9 +23,34 @@ whois.whois will return tuple type, which contains whois server address and the
To parse whois data, To parse whois data,
result = whois.parser("example.com", whoisData[1]) result = whois.Parser("example.com", whoisData[1]).parse()
Some whois servers of top level domains (like .com and .net) send redirect command in order to let clients to get more information, like address and phone number, from whois server of domain reseller. However, all whois servers have all different data format. So if you want parse the whois data more accurately, I recommend to set "redirect" parameter to `False` when querying, or if you want detailed information, please add data format of the whois server to tld config file and make a pull request. Some whois servers of top level domains (like .com and .net) send redirect command in order to let clients to get more information, like address and phone number, from whois server of domain reseller. However, all whois servers have all different data format. So if you want parse the whois data more accurately, I recommend to set "redirect" parameter to `False` when querying, or if you want detailed information, please add data format of the whois server to tld config file and make a pull request.
Config file structure Config file structure
----------- -----------
server = {
"host": "net.whois-servers.net",
"redirect": "\s+Whois Server: (.*)",
}
parse = {
"default": {
"NotFound": "No match for domain",
"DomainName": "Domain Name:\s+(.+)",
"Registrar": "Registrar:\s+(.+)",
"NameServer": "Name Server:\s+(.+)",
"Status": "Status:\s+(.+)",
"UpdatedDate": "Updated Date:\s+(.+)",
"CreationDate": "Creation Date:\s+(.+)",
"ExpirationDate": "Expiration Date:\s+(.+)",
},
"whois.dotname.co.kr":
{
},
}

View File

@ -0,0 +1,23 @@
server = {
"format": {
"jp.whois-servers.net": "%DOMAIN%/e",
}
}
parse = {
"default": {
"NotFound": "No match!!",
"DomainName": "\[Domain Name\]\s+(.+)",
"RegistrantName": "\[Registrant\]\s+(.+)",
"RegistrantAddress": "\[Postal Address\]\s+([\S\s]*)\n\[Phone\]",
"RegistrantPostralCode": "\[Postal code\]\s+(.+)",
"RegistrantEmail": "\[Email\]\s+(.+)",
"RegistrantPhone": "\[Phone\]\s+(.+)",
"RegistrantFax": "\[Fax\]\s+(.+)",
"CreationData": "\[Created on\]\s+(.+)",
"ExpirationDate": "\[Expires on\]\s+(.+)",
"UpdatedDate": "\[Last Updated\]\s+(.+)",
"NameServer": "\[Name Server\]\s+(.+)",
"Status": "\[Status\]\s+(.+)",
}
}