Add 'format' setting, so that users can set data format for each whois server. .com support. Bug fix.
This commit is contained in:
parent
7b49fb2a74
commit
ae1e769272
@ -123,6 +123,7 @@ class Parser(object):
|
|||||||
logging.debug("run: regex matches found for key %s. %s"%(key, matches))
|
logging.debug("run: regex matches found for key %s. %s"%(key, matches))
|
||||||
result.update({key: map(lambda x: x.strip(), matches)})
|
result.update({key: map(lambda x: x.strip(), matches)})
|
||||||
|
|
||||||
|
else:
|
||||||
logging.debug("run: No match for %s"%(key))
|
logging.debug("run: No match for %s"%(key))
|
||||||
|
|
||||||
print result
|
print result
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
server = {
|
||||||
|
"redirect": "\s+Whois Server: (.*)",
|
||||||
|
"format": {
|
||||||
|
"com.whois-servers.net": "domain %DOMAIN%",
|
||||||
|
"whois.verisign-grs.com": "domain %DOMAIN%",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
parse = {
|
||||||
|
"default": {
|
||||||
|
"LoadConf": "net/default",
|
||||||
|
},
|
||||||
|
}
|
||||||
@ -64,6 +64,10 @@ class Whois(object):
|
|||||||
logging.error("sendQuery: Error connecting to whois server %s"%(whoisServer))
|
logging.error("sendQuery: Error connecting to whois server %s"%(whoisServer))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
try:
|
||||||
|
msg = self.settings['format'][whoisServer].replace("%DOMAIN%", self.domain) + "\r\n"
|
||||||
|
|
||||||
|
except:
|
||||||
msg = self.domain + "\r\n"
|
msg = self.domain + "\r\n"
|
||||||
|
|
||||||
logging.debug("sendQuery: Sending data.. %s"%(msg))
|
logging.debug("sendQuery: Sending data.. %s"%(msg))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user