Moved function over
This commit is contained in:
parent
40c3fa5c9d
commit
6fca113ea3
22
main.py
22
main.py
@ -18,6 +18,18 @@ def splitLine(fileline):
|
|||||||
retval = []
|
retval = []
|
||||||
return tmpline
|
return tmpline
|
||||||
|
|
||||||
|
def lookup(ip):
|
||||||
|
net = Net(ip)
|
||||||
|
obj = IPASN(net)
|
||||||
|
results = obj.lookup()
|
||||||
|
pprint(results)
|
||||||
|
for key,value in results.iteritems():
|
||||||
|
if key == "asn_country_code":
|
||||||
|
print(value)
|
||||||
|
if key == "asn_cidr":
|
||||||
|
print(value)
|
||||||
|
|
||||||
|
|
||||||
ipListFile = openFile("iplist.txt")
|
ipListFile = openFile("iplist.txt")
|
||||||
ipList = ipListFile.read()
|
ipList = ipListFile.read()
|
||||||
test = splitLine(ipList)
|
test = splitLine(ipList)
|
||||||
@ -42,13 +54,3 @@ for value in ips:
|
|||||||
#for a in ipList:
|
#for a in ipList:
|
||||||
# print(a)
|
# print(a)
|
||||||
|
|
||||||
def lookup(ip):
|
|
||||||
net = Net(ip)
|
|
||||||
obj = IPASN(net)
|
|
||||||
results = obj.lookup()
|
|
||||||
pprint(results)
|
|
||||||
for key,value in results.iteritems():
|
|
||||||
if key == "asn_country_code":
|
|
||||||
print(value)
|
|
||||||
if key == "asn_cidr":
|
|
||||||
print(value)
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user