Finished basic addition of uk domain lookups, need to figure out how to properly do it
This commit is contained in:
parent
455b821fde
commit
628f96d293
2
tests/out.txt
Normal file
2
tests/out.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'chooseServer', 'query', 'sendHTTPQuery', 'sendQuery']
|
||||||
|
{'Status': ['Registered until expiry date.'], 'UpdatedDate': ['29-Apr-2017'], 'Registrar': ['Nom-IQ Limited t/a Com Laude [Tag = NOMIQ]'], 'ExpirationDate': ['03-May-2018'], 'DomainName': ['amamzon.co.uk'], 'NameServer': ['pdns1.ultradns.net'], 'CreationDate': ['03-May-2001'], 'RegistrantName': ['Amazon Europe Core S.?.r.l.']}
|
||||||
@ -6,7 +6,7 @@ from whois import whois
|
|||||||
from whois import parser
|
from whois import parser
|
||||||
|
|
||||||
print dir(whois)
|
print dir(whois)
|
||||||
domain = "example.com"
|
domain = "amamzon.co.uk"
|
||||||
w = whois(domain, True)
|
w = whois(domain, True)
|
||||||
t = w.query(False)
|
t = w.query(False)
|
||||||
p = parser.Parser(domain, t[1], t[0], True)
|
p = parser.Parser(domain, t[1], t[0], True)
|
||||||
|
|||||||
@ -134,9 +134,8 @@ class Parser(object):
|
|||||||
for key in self.parseConf:
|
for key in self.parseConf:
|
||||||
matches = re.findall(self.parseConf[key], self.text, re.MULTILINE)
|
matches = re.findall(self.parseConf[key], self.text, re.MULTILINE)
|
||||||
if matches:
|
if matches:
|
||||||
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:
|
else:
|
||||||
logging.debug("run: No match for %s"%(key))
|
logging.debug("run: No match for %s"%(key))
|
||||||
|
|
||||||
|
|||||||
@ -5,20 +5,20 @@ server = {
|
|||||||
|
|
||||||
parse = {
|
parse = {
|
||||||
"default": {
|
"default": {
|
||||||
"NotFound": "No Data Found",
|
"NotFound": "No match for",
|
||||||
"DomainName": "Domain name:\s+(.+)",
|
"DomainName": "Domain name:\s+(.+|\n)",
|
||||||
"Registrar": "Registrar Name:\s+(.+)",
|
"Registrar": "Registrar:\s+(.+)",
|
||||||
"NameServer": "Name servers:\s+(.+)",
|
"NameServer": "Name servers:\s+(.+)",
|
||||||
"Status": "Registration status:\s+(.+)",
|
"Status": "Registration status:\s+(.+)",
|
||||||
"UpdatedDate": "Last updated:\s+(.+)",
|
"UpdatedDate": "Last updated:\s+(.+)",
|
||||||
"CreationDate": "Registered on:\s+(.+)",
|
"CreationDate": "Registered on:\s+(.+)",
|
||||||
"ExpirationDate": "Expiry date:\s+(.+)",
|
"ExpirationDate": "Expiry date:\s+(.+)",
|
||||||
# "RegistrantName": "Registrant:(.+)",
|
"RegistrantName": "Registrant:\s(.+)",
|
||||||
"EligibilityName": "Registrant:\s+(.+)",
|
# "EligibilityName": "Registrant:\s+(.+)",
|
||||||
"EligibilityType": "Eligibility Type:(.+)",
|
# "EligibilityType": "Eligibility Type:(.+)",
|
||||||
"AdminID": "Registrant Contact ID:(.+)",
|
# "AdminID": "Registrant Contact ID:(.+)",
|
||||||
"AdminName": "Registrant Contact Name:(.+)",
|
# "AdminName": "Registrant Contact Name:(.+)",
|
||||||
"TechName": "Tech Contact Name:(.+)",
|
# "TechName": "Tech Contact Name:(.+)",
|
||||||
"TechID": "Tech Contact ID:(.+)",
|
# "TechID": "Tech Contact ID:(.+)",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user