matts0613 icon

IP Geolocation Script.py

matts0613 | PRO | 03/29/19 01:33:03 AM UTC | 0 ⭐ | 229 👁️ | Never ⏰ | []
Python |

350 B

|

None

|

0 👍

/

0 👎

import re
import json
from urllib2 import urlopen
 
url = 'http://ipinfo.io/json'
response = urlopen(url)
data = json.load(response)
 
IP=data['ip']
org=data['org']
city = data['city']
country=data['country']
region=data['region']
 
print 'Your IP detail\n '
print 'IP : {4} \nRegion : {1} \nCountry : {2} \nCity : {3} \nOrg : {0}'.format(org,region,country,city,IP)

Comments