Open GoogleCodeExporter opened 9 years ago
[deleted comment]
Seems likes the url which provides the GeoLocationAPI was shutdown by Google,
[https://code.google.com/p/gears/wiki/GeolocationAPI]
If you look in the file, libnamebench/geoip.py line +37
you can see the old url.
33 NOTE: This is in violation of the Gears Terms of Service. See:
34 http://code.google.com/p/gears/wiki/GeolocationAPI
35 """
36 h = httplib2.Http(tempfile.gettempdir(), timeout=10)
37 url = 'http://www.google.com/loc/json'
38 post_data = {'request_address': 'true', 'version': '1.1.0', 'source': 'namebench'}
39 unused_resp, content = h.request(url, 'POST', simplejson.dumps(post_data))
40 try:
41 data = simplejson.loads(content)['location']
42 return {
43 'region_name': data['address'].get('region'),
44 'country_name': data['address'].get('country'),
45 'country_code': data['address'].get('country_code'),
46 'city': data['address'].get('city'),
47 'latitude': data['latitude'],
48 'longitude': data['longitude'],
49 'source': 'gloc'
50 }
51 except:
52 print '* Failed to use GoogleLocAPI: %s (content: %s)' % (util.GetLastExceptionString(), content)
53 return {}
Original comment by ra...@rabin.io
on 31 Jul 2014 at 11:11
Original issue reported on code.google.com by
george.p...@gmail.com
on 22 Apr 2014 at 11:35