Geo Location extracted from visitors ip address

Νίκος Gr33k nikos at superhost.gr
Sat Jul 6 10:01:46 CEST 2013


Στις 6/7/2013 4:41 πμ, ο/η Νίκος Gr33k έγραψε:
> Yes i know iam only storing the ISP's city instead of visitor's homeland
> but this is the closest i can get:
>
> try:
>    gi = pygeoip.GeoIP('/home/nikos/GeoLiteCity.dat')
>    city = gi.time_zone_by_addr( os.environ['HTTP_CF_CONNECTING_IP'] )
>    host = socket.gethostbyaddr( os.environ['HTTP_CF_CONNECTING_IP'] )
> except Exception as e:
>    host = repr(e)
>
>
> Tried it myself and it falsey said that i'am from Europe/Athens (capital
> of Greece) while i'am from Europe/Thessaloniki (sub-capital of Greece)
>
> If we can pin-point the uvisitor more accurately plz let me know.

Good morning from Greece,

All my Greece visitors as Dave correctly said have the ISP address which 
here in Greece is Europe/Athens, so i have now way to distinct the 
cities of the visitors.

Is there any way to pinpoint the visitor's exact location?


-- 
What is now proved was at first only imagined!



More information about the Python-list mailing list