Compare commits
No commits in common. "117ce36da53c2474cad2845c08da39b1d7ca60c8" and "98442178acf16b1a4f77581f176fddd9101ffef3" have entirely different histories.
117ce36da5
...
98442178ac
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,2 @@
|
||||
env/
|
||||
.vscode/
|
||||
*.pyc
|
||||
.vscode/
|
||||
@ -1,16 +1,43 @@
|
||||
from flask import Flask, request
|
||||
from flask_restful import Resource, Api
|
||||
import utils
|
||||
import json
|
||||
|
||||
app = Flask(__name__)
|
||||
api = Api(app)
|
||||
|
||||
|
||||
class WhoIS():
|
||||
def __init__(self, domain):
|
||||
self.domain = domain
|
||||
self.getWhois()
|
||||
|
||||
def getWhois(self):
|
||||
self.registrar = 'Synergy Wholesale'
|
||||
self.status = ['clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited', 'clientTransferProhibited https://icann.org/epp#clientTransferProhibited', 'clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited',
|
||||
'serverDeleteProhibited https://icann.org/epp#serverDeleteProhibited', 'serverTransferProhibited https://icann.org/epp#serverTransferProhibited', 'serverUpdateProhibited https://icann.org/epp#serverUpdateProhibited']
|
||||
self.registrant = {'name': 'Test Case', 'email': 'tcase@test.com',
|
||||
'eligibilitytype': 'Company', 'eligibilityid': '123456789'}
|
||||
self.nameservers = ['ns1.dommain.tld', 'ns2.domain.tld']
|
||||
|
||||
|
||||
class DNS():
|
||||
def __init__(self, domain):
|
||||
self.domain = domain
|
||||
self.getRecords()
|
||||
|
||||
def getRecords(self):
|
||||
self.a = '1.2.3.4'
|
||||
self.aaaa = '2001:0db8:85a3:0000:0000:8a2e:0370:7334'
|
||||
self.mx = {'mail.domain.tld': 10}
|
||||
self.txt = 'v=spf1 +a +mx +include:spf.hostingplatform.net.au'
|
||||
self.ns = ['ns1.domain.tld', 'ns2.domain.tld']
|
||||
self.soa = 'ns1.domain.tld. webmaster.domain.tld. 310875860 900 900 1800 60'
|
||||
|
||||
|
||||
class Domain():
|
||||
def __init__(self, domain):
|
||||
self.whois = utils.whoisData.WhoIS(domain).__dict__
|
||||
self.dns = utils.dns.DNS(domain).__dict__
|
||||
self.whois = WhoIS(domain).__dict__
|
||||
self.dns = DNS(domain).__dict__
|
||||
|
||||
|
||||
class DNSLookup(Resource):
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
from . import dns
|
||||
from . import whoisData
|
||||
12
utils/dns.py
12
utils/dns.py
@ -1,12 +0,0 @@
|
||||
class DNS():
|
||||
def __init__(self, domain):
|
||||
self.domain = domain
|
||||
self.getRecords()
|
||||
|
||||
def getRecords(self):
|
||||
self.a = '1.2.3.4'
|
||||
self.aaaa = '2001:0db8:85a3:0000:0000:8a2e:0370:7334'
|
||||
self.mx = {'mail.domain.tld': 10}
|
||||
self.txt = 'v=spf1 +a +mx +include:spf.hostingplatform.net.au'
|
||||
self.ns = ['ns1.domain.tld', 'ns2.domain.tld']
|
||||
self.soa = 'ns1.domain.tld. webmaster.domain.tld. 310875860 900 900 1800 60'
|
||||
@ -1,22 +0,0 @@
|
||||
import whois
|
||||
|
||||
|
||||
class WhoIS():
|
||||
def __init__(self, domain):
|
||||
self.domain = domain
|
||||
self.getWhois(domain)
|
||||
|
||||
def getWhois(self, domain):
|
||||
whoisData = whois.whois.Whois(domain).query()
|
||||
whoisData = whois.parser.Parser(domain, whoisData[1]).parse()
|
||||
self.registrar = whoisData.get('Registrar')
|
||||
self.status = whoisData.get('Status')
|
||||
self.registrant = self.buildRegistrantInfo(whoisData)
|
||||
self.nameservers = whoisData.get('NameServer')
|
||||
|
||||
def buildRegistrantInfo(self, whoisData):
|
||||
ret = {}
|
||||
ret['registrantName'] = whoisData.get('RegistrantName')
|
||||
ret['eligibilityType'] = whoisData.get('EligibilityType')
|
||||
ret['registrantID'] = whoisData.get('RegistrantID')
|
||||
return ret
|
||||
Loading…
x
Reference in New Issue
Block a user