PyGeoIpMap icon indicating copy to clipboard operation
PyGeoIpMap copied to clipboard

freegeoip.net is down

Open denics opened this issue 10 years ago • 0 comments

Hi @pierrrrrrre , very nice script thanks! It is very useful for reports! Unfortunately freegeoip is down now so the script does not work anymore. For this I have just hacked the script to include:

diff --git a/pygeoipmap.py b/pygeoipmap.py
index 2fddb0f..0b1816a 100644
--- a/pygeoipmap.py
+++ b/pygeoipmap.py
@@ -31,9 +31,10 @@ def get_lat_lon(ip_list=[], lats=[], lons=[]):
     """
     print("Processing {} IPs...".format(len(ip_list)))
     for ip in ip_list:
-        r = requests.get("https://freegeoip.net/json/" + ip)
+        #r = requests.get("https://freegeoip.net/json/" + ip)
+        r = requests.get("https://www.telize.com/geoip/" + ip)
         json_response = r.json()
-        print("{ip}, {region_name}, {country_name}, {latitude}, {longitude}".format(**json_response))
+        print("{ip}, {continent_code}, {country}, {latitude}, {longitude}".format(**json_response))
         if json_response['latitude'] and json_response['longitude']:
             lats.append(json_response['latitude'])
             lons.append(json_response['longitude'])

and use telize.com. I did not do a merge request because telize will shut down soon too . Thanks again, Denis

denics avatar Nov 10 '15 11:11 denics