“OpenSource IP -Tracker Python” Code-Antworten

OpenSource IP -Tracker Python

import os
import urllib.request as urllib2
import json


'''An example of an IP tracker for public domain like youtube
(ip: 172.217.193.190). It can not track private ip's, 
it will return an error. The values variable, hold a returned dictionary
which can be further processed.'''

while True:
  ip = input("Input target ip:")
  url = "http://ip-api.com/json/"
  response = urllib2.urlopen (url+ip)
  data = response.read()
  values = json.loads(data)
  print(values)
  cont = input("Track another IP address? [y/n] ")
  if cont == "y" or cont == "Y":
      continue
  else:
     break
os.system("clear") 
os._exit(0)
Coderunner

So erstellen Sie einen IP -Tracker in Python

import os
import urllib2
import jsonwhile True:
ip=raw_input (“what is your target ip:”)
url = “http://ip-api.com/json/”
response = urllib2.urlopen (url +ip)
data = response.read()
values = json.loads(data)print(“IP:” + values [‘query’])
print(“City:” + values [‘city’])
print(“ISP:” + values [‘isp’])
print(“Country:” + values [‘country’])
print(“Region:” + values [‘region’])
print(“Time Zoen:” + values [‘timezone’])break
Cryptic

Ähnliche Antworten wie “OpenSource IP -Tracker Python”

Fragen ähnlich wie “OpenSource IP -Tracker Python”

Weitere verwandte Antworten zu “OpenSource IP -Tracker Python” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen