Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #50524

GeoIP2 for retrieving city and region ?

From Νικόλας <nikos@superhost.gr>
Newsgroups comp.lang.python
Subject GeoIP2 for retrieving city and region ?
Date 2013-07-12 17:18 +0300
Organization GRNET - Greek Research and Technology Network
Message-ID <krp37d$jt$2@news.grnet.gr> (permalink)

Show all headers | View raw


Hello, iam still looking for a way to identify the city of my website 
visitors.

The closet i have gone is to come up with the visitor's ISP city:

try:
	gi = pygeoip.GeoIP('/usr/local/share/GeoLiteCity.dat')
	city = gi.time_zone_by_addr( os.environ['HTTP_CF_CONNECTING_IP'] )
	host = socket.gethostbyaddr( os.environ['HTTP_CF_CONNECTING_IP'] )[0]
except Exception as e:
	host = repr(e)


But today i was searching again for this and found out about geoip2, 
maybe that would help more.


 >>> import geoip2
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
ImportError: No module named 'geoip2'


     >>> client = geoip2.webservices.Client(42, 'abcdef123456')
     >>> omni = client.omni('24.24.24.24')
     >>> country = omni.country
     >>> print(country.iso_code)


I cant even import the module even though my 'pip install geopip2' was 
successful

There is definately i way to identify the users location based solely on 
its ip address as this site does it: http://www.geoiptool.com/

Google, MS, facebook and twitter are not the only ones that can do it?

Perhaps this is being done by giving  longitude and latitude?
-- 
What is now proved was at first only imagined!

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-12 17:18 +0300
  Re: GeoIP2 for retrieving city and region ? Dave Angel <davea@davea.name> - 2013-07-12 11:32 -0400
    Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-12 18:52 +0300
      Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-12 19:32 +0300
        Re: GeoIP2 for retrieving city and region ? Grant Edwards <invalid@invalid.invalid> - 2013-07-12 16:38 +0000
          Re: GeoIP2 for retrieving city and region ? Chris Angelico <rosuav@gmail.com> - 2013-07-13 02:47 +1000
          Re: GeoIP2 for retrieving city and region ? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-07-12 19:04 -0400
            Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-13 08:48 +0300
              Re: GeoIP2 for retrieving city and region ? Chris Angelico <rosuav@gmail.com> - 2013-07-13 15:53 +1000
                Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-13 09:07 +0300
                Re: GeoIP2 for retrieving city and region ? Chris Angelico <rosuav@gmail.com> - 2013-07-13 16:22 +1000
                Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-13 09:28 +0300
                Re: GeoIP2 for retrieving city and region ? Lele Gaifax <lele@metapensiero.it> - 2013-07-13 10:12 +0200
                Re: GeoIP2 for retrieving city and region ? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-07-13 12:48 -0400
                Re: GeoIP2 for retrieving city and region ? Roy Smith <roy@panix.com> - 2013-07-13 12:59 -0400
                Re: GeoIP2 for retrieving city and region ? Wayne Werner <wayne@waynewerner.com> - 2013-07-13 13:35 -0500
          Re: GeoIP2 for retrieving city and region ? Chris Angelico <rosuav@gmail.com> - 2013-07-13 10:36 +1000
          Re: GeoIP2 for retrieving city and region ? Joel Goldstick <joel.goldstick@gmail.com> - 2013-07-12 19:42 -0400
        Re: GeoIP2 for retrieving city and region ? Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-12 11:19 -0600
        Re: GeoIP2 for retrieving city and region ? Terry Reedy <tjreedy@udel.edu> - 2013-07-12 18:07 -0400
        Re: GeoIP2 for retrieving city and region ? MRAB <python@mrabarnett.plus.com> - 2013-07-12 23:07 +0100
          Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-13 08:32 +0300
            Re: GeoIP2 for retrieving city and region ? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-07-13 12:54 -0400
              Re: GeoIP2 for retrieving city and region ? Roy Smith <roy@panix.com> - 2013-07-13 13:09 -0400
              Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-13 20:43 +0300
                Re: GeoIP2 for retrieving city and region ? Roy Smith <roy@panix.com> - 2013-07-13 14:19 -0400
                Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-13 21:23 +0300
                Re: GeoIP2 for retrieving city and region ? Roy Smith <roy@panix.com> - 2013-07-13 14:30 -0400
                Re: GeoIP2 for retrieving city and region ? Michael Torrie <torriem@gmail.com> - 2013-07-13 16:57 -0600
                Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-16 22:43 +0300
                Re: GeoIP2 for retrieving city and region ? Joel Goldstick <joel.goldstick@gmail.com> - 2013-07-16 15:51 -0400
                Re: GeoIP2 for retrieving city and region ? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-07-16 20:51 -0400
                Re: GeoIP2 for retrieving city and region ? Chris Angelico <rosuav@gmail.com> - 2013-07-17 10:58 +1000
                Re: GeoIP2 for retrieving city and region ? Tim Chase <python.list@tim.thechases.com> - 2013-07-14 13:32 -0500
                Re: GeoIP2 for retrieving city and region ? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-07-13 14:21 -0400
                Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-13 21:28 +0300
                Re: GeoIP2 for retrieving city and region ? Chris Angelico <rosuav@gmail.com> - 2013-07-14 09:12 +1000
                Re: GeoIP2 for retrieving city and region ? Wayne Werner <wayne@waynewerner.com> - 2013-07-13 13:46 -0500
                Re: GeoIP2 for retrieving city and region ? Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-07-13 11:17 -0700
                Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-15 16:25 +0300
                Re: GeoIP2 for retrieving city and region ? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-07-15 20:34 -0400
                Re: GeoIP2 for retrieving city and region ? Michael Torrie <torriem@gmail.com> - 2013-07-15 20:48 -0600
                Re: GeoIP2 for retrieving city and region ? alex23 <wuwei23@gmail.com> - 2013-07-17 10:07 +1000
            Re: GeoIP2 for retrieving city and region ? Chris Angelico <rosuav@gmail.com> - 2013-07-14 03:03 +1000
        Re: GeoIP2 for retrieving city and region ? Michael Torrie <torriem@gmail.com> - 2013-07-12 16:15 -0600
      Re: GeoIP2 for retrieving city and region ? Joel Goldstick <joel.goldstick@gmail.com> - 2013-07-12 12:24 -0400
    Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-14 08:18 +0300
      Re: GeoIP2 for retrieving city and region ? Chris Angelico <rosuav@gmail.com> - 2013-07-14 15:24 +1000
        Re: GeoIP2 for retrieving city and region ? Νικόλας <nikos@superhost.gr> - 2013-07-14 10:51 +0300
  Re: GeoIP2 for retrieving city and region ? Chris Angelico <rosuav@gmail.com> - 2013-07-13 02:41 +1000

csiph-web