Geo Location extracted from visitors ip address
nikos at superhost.gr
Sat Jul 6 01:55:43 CEST 2013
Στις 5/7/2013 10:58 μμ, ο/η Tim Chase έγραψε:
> On 2013-07-05 22:08, Νίκος Gr33k wrote:
>> Is there a way to extract out of some environmental variable the
>> Geo location of the user being the city the user visits out website
>> Perhaps by utilizing his originated ip address?
> Yep. You can get an 11MB database (17MB uncompressed)
> http://pypi.python.org/pypi/pygeoip/ # pure Python
Thank you very much Tim.
i am know tryitn to use it as:
gic = pygeoip.GeoIP('/root/GeoIPCity.dat')
host = gic.time_zone_by_addr( os.environ['HTTP_CF_CONNECTING_IP'] )
except Exception as e:
host = repr(e)
lets hope it will work!
What is now proved was at first only imagined!
More information about the Python-list