dimanche 22 novembre 2015

FreeGeoIP giving location of host

I'm trying to figure out the location of a web user based on IP, and I'm using the following code from a StackOverflow post

import requests
import json

send_url = 'http://ift.tt/1lyLGdn'
r = requests.get(send_url)
j = json.loads(r.text)
lat = j['latitude']
lon = j['longitude']

Unfortunately, the website is hosted by Azure and I'm freegeoip.net is giving me a location in Seattle, WA, presumably near the Microsoft headquarters. Any ideas on how to resolve this?




Aucun commentaire:

Enregistrer un commentaire