Compare commits
No commits in common. "77662bdc3e31c0f0d34a36fd523c7d47e9ad244b" and "117ce36da53c2474cad2845c08da39b1d7ca60c8" have entirely different histories.
77662bdc3e
...
117ce36da5
@ -1,6 +1,7 @@
|
|||||||
from flask import Flask, request
|
from flask import Flask, request
|
||||||
from flask_restful import Resource, Api
|
from flask_restful import Resource, Api
|
||||||
import utils
|
import utils
|
||||||
|
import json
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
api = Api(app)
|
api = Api(app)
|
||||||
|
|||||||
@ -12,27 +12,11 @@ class WhoIS():
|
|||||||
self.registrar = whoisData.get('Registrar')
|
self.registrar = whoisData.get('Registrar')
|
||||||
self.status = whoisData.get('Status')
|
self.status = whoisData.get('Status')
|
||||||
self.registrant = self.buildRegistrantInfo(whoisData)
|
self.registrant = self.buildRegistrantInfo(whoisData)
|
||||||
self.nameservers = self.splitNameservers(
|
self.nameservers = whoisData.get('NameServer')
|
||||||
whoisData.get('NameServer'))
|
|
||||||
self.createDate = whoisData.get('CreationDate')
|
|
||||||
self.expireDate = whoisData.get('ExpirationDate')
|
|
||||||
# self.nameservers = whoisData.get('NameServer')
|
|
||||||
|
|
||||||
def buildRegistrantInfo(self, whoisData):
|
def buildRegistrantInfo(self, whoisData):
|
||||||
print(whoisData)
|
|
||||||
ret = {}
|
ret = {}
|
||||||
ret['registrantName'] = whoisData.get('RegistrantName')
|
ret['registrantName'] = whoisData.get('RegistrantName')
|
||||||
ret['eligibilityType'] = whoisData.get('EligibilityType')
|
ret['eligibilityType'] = whoisData.get('EligibilityType')
|
||||||
ret['registrantID'] = whoisData.get('RegistrantID')
|
ret['registrantID'] = whoisData.get('RegistrantID')
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
# I hate this, kill me now
|
|
||||||
def splitNameservers(self, nameservers):
|
|
||||||
ret = []
|
|
||||||
if '\n' in nameservers[0]:
|
|
||||||
nameservers = nameservers[0]
|
|
||||||
nameservers = nameservers.split('\n')
|
|
||||||
for x in nameservers:
|
|
||||||
ret.append(x.strip())
|
|
||||||
return ret
|
|
||||||
return nameservers
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user