Re: GeoIP2 for retrieving city and region ?

2013-07-16 Thread Νικόλας

Στις 14/7/2013 1:57 πμ, ο/η Michael Torrie έγραψε:

On 07/13/2013 12:23 PM, Νικόλας wrote:

Do you know a way of implementing anyone of these methods to a script?


Yes.  Modern browsers all support a location API in the browser for
javascript.  See this:

http://diveintohtml5.info/geolocation.html



Lest say i embed inside my index.html the Javascript Geo Code.

Is there a way to pass Javascript's outcome to my Python cgi script somehow?

Can Javascript and Python Cgi somehow exchnage data?
--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-15 Thread Νικόλας

Στις 13/7/2013 9:17 μμ, ο/η Benjamin Kaplan έγραψε:

On Sat, Jul 13, 2013 at 10:43 AM, Νικόλας ni...@superhost.gr wrote:

Στις 13/7/2013 7:54 μμ, ο/η Dennis Lee Bieber έγραψε:


 Are you paying for a fixed IP number? I suspect you are if you
were
running a world-accessible server.

 Obviously a fixed IP will be tied to a fixed connection and
thereby to
a fixed location which can be provided to a location database.

 But most of us have DHCP assigned IP numbers, which change
everytime we
reboot our connection (or even when the DHCP lease expires -- which may be
daily).



Same networking scheme for me too, dynamic that is.

Every time the DHCP lease expires or i reboot the router i get a new ip
address but every time the link i provided states accurately that my ip
address is from Thessaloníki and not Europe/Athens which is were my ISP
location is.

Not to mention that in facebook, no matter the way i'am joining, via
smartphone, tablet, laptop it always pinpoints my exact location.

But yes, i can understand your skepticism.
An ip address can move anywhere while remaining connected to the same ISP,
just like a networking device in the house, remains connected to the same
router while changing rooms or even floors, or even buildings.

But then how do you explain the fact that
http://www.maxmind.com/en/geoip_demo
pinpointed Thessaloníki and not Athens and for 2 friends of mine that use
the same ISP as me but live in different cities also accurately identified
their locations too?



It's not telling you where your ISP is headquartered. It's telling you
where the servers that you're connecting to are. In your case, you're
connecting to servers that your Athens-based ISP has in a Thessaloniki
datacenter. The only way to get an accurate location is to use
something other than IP- phones like to use a combination of their
GPS, a map of the cell phone towers, and a map of wi-fi hotspots (this
is one of the things that Google's StreetView cars log as they drive).


Actually that happens only for my ISP(FORTHnet).
For other ISPs all locations boil down just to Europe/Athens.
This happens to be because my ISP's network scheme is to assign blcoks 
of ip addresses per city in Greek area.


Same thing doesn't apply for others ISPs unfortunately here in Greece.

I have no idea how to implement the solution you proposed.
These are nice ideas we need to have a way of implement them within a 
script.


I have no way of grasping a map of cell towers of a  map of wi-fi hotspots.

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-14 Thread Νικόλας

Στις 14/7/2013 8:24 πμ, ο/η Chris Angelico έγραψε:

On Sun, Jul 14, 2013 at 3:18 PM, ��� ni...@superhost.gr wrote:

Can we get the location serived from lat/long coordinates?


Yes, assuming you get accurate latitude and longitude, so you're back
to square 1.

ChrisA




Dear Freelance,

Thank you for your interest in MaxMind Web Services. We have set up a 
demo account which includes the following web service(s):


GeoIP City Demo (1000 lookups available)
Usage:
http://geoip.maxmind.com/b?l=YOUR_LICENSE_KEYi=24.24.24.24
Example scripts may be found at: http://dev.maxmind.com/geoip/web-services

GeoIP City with ISP and Organization Demo (1000 lookups available)
Usage:
http://geoip.maxmind.com/f?l=YOUR_LICENSE_KEYi=24.24.24.24
Example scripts may be found at: http://dev.maxmind.com/geoip/web-services

Lets see if that would be of any help.
Please try it too you can request a demo trial of maxminds Geo web services.

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Νικόλας

Στις 13/7/2013 8:53 πμ, ο/η Chris Angelico έγραψε:

On Sat, Jul 13, 2013 at 3:48 PM, ��� ni...@superhost.gr wrote:

 13/7/2013 2:04 ��, �/� Dennis Lee Bieber ��:


On Sat, 13 Jul 2013 02:47:38 +1000, Chris Angelico ros...@gmail.com
declaimed the following:



Oh, and just for laughs, I tried a few of my recent mobile IP
addresses in the GeoIP lookup. All of them quoted Melbourne someplace,
some in the CBD and some out in the suburbs, but all vastly wrong, and
places I haven't been. But I'd never expect it to be accurate on
those.


 Well... the MaxMind demo of my IP did get the proper
metropolitan
area... But they list the ISP as ATT... My real ISP is Earthlink
(piggybacking on ATT DSL service).

 The Lat/Long, however shows as

42.9634 -85.6681
whereas a recent GPS readout shows
42.9159 -85.5541

or 2m50s too far north, and 6m50s too far west.

 Same website, accessed from my Blackberry phone, gave a result of
United States, NA and location 38 -97




I have read all your answer very carefully but i still need some way of
getting it done.

All my Greek website visitors say they are from Europe/Athens which is the
ISP's location and not user's homeland.

Well it worked for me but as many other told me it wasn't accurate for them
too.

Please try this:  http://www.maxmind.com/en/geoip_demo

and tell me if maxmind's database can pippont you city's location.


Nikos, you keep asking for a way to do the impossible. We keep telling
you that it is impossible. No alternative technique will do what
cannot be done!

I just tried that on my two IPs and it was quite wrong on both of them
- further wrong than some of the others have been.

Stop expecting magic.

ChrisA



But it works for me, How can it be impossible and worked for me at the 
same time?


Also i tried some other website that asked me to allow it to run a 
javascript on my browser and it pinpointed even my street!


If it wasnt possbile then MaxMind would be seeling its GeoIP2 app for 
1380$ per year.


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Νικόλας

Στις 13/7/2013 9:22 πμ, ο/η Chris Angelico έγραψε:

On Sat, Jul 13, 2013 at 4:07 PM, ��� ni...@superhost.gr wrote:

But it works for me, How can it be impossible and worked for me at the same
time?


If I roll ten six-sided dice, will they total 35? Maybe. Maybe they'll
be close. But it's impossible to come up with a table for rolling
those dice on that will guarantee you exactly 35 every time.



I just had some other friends of me, who live in different cities around 
Greece to test the link i gave to you in my previous post and for all of 
them it returned the correct city of their origin.


Seems like GeoIP2 is doing a better job that its predecessor GeopIP.

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Νικόλας

Στις 13/7/2013 7:54 μμ, ο/η Dennis Lee Bieber έγραψε:

Are you paying for a fixed IP number? I suspect you are if you were
running a world-accessible server.

Obviously a fixed IP will be tied to a fixed connection and thereby to
a fixed location which can be provided to a location database.

But most of us have DHCP assigned IP numbers, which change everytime we
reboot our connection (or even when the DHCP lease expires -- which may be
daily).


Same networking scheme for me too, dynamic that is.

Every time the DHCP lease expires or i reboot the router i get a new ip 
address but every time the link i provided states accurately that my ip 
address is from Thessaloníki and not Europe/Athens which is were my ISP 
location is.


Not to mention that in facebook, no matter the way i'am joining, via 
smartphone, tablet, laptop it always pinpoints my exact location.


But yes, i can understand your skepticism.
An ip address can move anywhere while remaining connected to the same 
ISP, just like a networking device in the house, remains connected to 
the same router while changing rooms or even floors, or even buildings.


But then how do you explain the fact that
http://www.maxmind.com/en/geoip_demo
pinpointed Thessaloníki and not Athens and for 2 friends of mine that 
use the same ISP as me but live in different cities also accurately 
identified their locations too?


I

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Νικόλας

Στις 13/7/2013 9:19 μμ, ο/η Roy Smith έγραψε:

In article krs3jj$vnq$1...@news.grnet.gr,
  ÉΪÉ«É»όλας ni...@superhost.gr wrote:


But then how do you explain the fact that
http://www.maxmind.com/en/geoip_demo pinpointed Thessalon£ki and not
Athens and for 2 friends of mine that use the same ISP as me but live
in different cities also accurately identified their locations too?


I just tried 24.136.109.105 on that demo.  It comes up with:

US Englewood Cliffs,
New Jersey,
United States,
North America
07632 40.8915,
-73.9471
Time Warner Cable
Time Warner Cable
rr.com
501

Not bad.  Google street view shows that as a very pretty residential
neighborhood in one of New York's fancier suburbs.  Unfortunately, it
happens to be in run-down industrial building in a factory district
about 20 km away.

There are lots of interesting (and superior) ways to do geolocation
other than looking up IP addresses.  Here's a few:

1) GPS.  Obviously, if you're on a device that has a GPS receiver and
you have access to that data, and you've got a good signal, nothing is
going to beat GPS.  Well, other than Glonass.  And Galileo and IRNSS,
whenever they become operational.  And whatever the Chinese are calling
theirs.

2) Cell (i.e. mobile) phone tower triangulation.  The phone systems know
where all the towers are and know which towers your phone is receiving
signal from.  Since they know the signal strengths from each of those
towers, they can do a rough triangulation.  It's kind of messy since
signal propagation depends terrain and obstructions which aren't well
mapped.  But it's better than nothing.

3) WiFi triangulation.  Right now, I can see four WiFi networks (Worb,
J24, MusicWiFi, and jcglinksys).  There are databases of WiFi network
names and approximate locations (obtained by wardriving and other ways).
If you can see enough networks, it's easy to look in the database and
figure out where you must be.

4) Who knows what the future will bring.  I suppose some day, inertial
nav will become cheap enough that we'll all be walking around with INS
in our phones.

In general, mobile operating systems control direct access to all of
these signals and only allow applications to get the location data when
the user agrees to such access.


Do you know a way of implementing anyone of these methods to a script?

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Νικόλας

Στις 13/7/2013 9:21 μμ, ο/η Dennis Lee Bieber έγραψε:

On Sat, 13 Jul 2013 20:43:14 +0300, ??? ni...@superhost.gr declaimed
the following:


But then how do you explain the fact that
http://www.maxmind.com/en/geoip_demo
pinpointed Thessalon�ki and not Athens and for 2 friends of mine that
use the same ISP as me but live in different cities also accurately
identified their locations too?


You have encountered an ISP that reserves IP blocks for specific
suburbs/cities -- and can be tracked thereby. That is, all IPs in
xxx.yyy.zzz.??? may be held for just one neighborhood (granted, I've
defined an old class C network there, but modern network assignments are no
longer in A/B/C (8/16/24 bit network address, with 24/16/8 bit node
addresses) assignments.

It all comes down to how the ISP allocates addresses. It may be that
(as in my case) the ISP is irrelevant -- the IP is issued by the phone
company that actually provides the DSL, and a block of IPs is allocated to
each central office of that phone company... And thereby, regardless of
the lease renewal, the IP is still identified as belonging to that central
office location (or whatever location the phone company supplies to the
location service for the IP block).



You are right and i can back this up.

While FORTHnet ISP(my ISP) works well with maxmind which can pinpoint 
the visitor's exact location other ISPs like Cyta, OTEnet, HOL always 
says Europe/Athens.


So it seems that all boil down to the way the ISP configure its blocks 
of ip addresses per city.


All should do the same and then it would be an easy task to accurately 
identify a visitor by its ip address.


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Νικόλας

Can we get the location serived from lat/long coordinates?

Using a mapping service you can create a query that asks what is the 
smallest region that contains points [(x1, y1), (x2, y2),...] and use 
that as our geolocate answer?


That should work, can you show me how such thing can be done please?
--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


GeoIP2 for retrieving city and region ?

2013-07-12 Thread Νικόλας
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!
--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Νικόλας

Στις 12/7/2013 6:32 μμ, ο/η Dave Angel έγραψε:


I suggest you read that geoiptool site, in particular the page

http://www.geoiptool.com/en/ip_info/

There is some misinformation, but notice carefully the part about
dynamic IP addresses.  Probably 99% of the individual users on the web
(the ones using a browser) have dynamic IP addresses.  The fixed ones
are needed by servers, and especially for DNS use, where the name lookup
wants to be stable for relatively log periods of time.



I did, for me it gives exact city location and not the ISP's city location.

I dont know whay for you ti just says Kansas, it shoudln't, since it 
susing longitute and latitude, it should have been accurate.


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Νικόλας


I know i have asked before but hwta i get is ISP city not visitors 
precise city.


GeoLiteCity.dat isnt accurate that's why it comes for free.
i must somehow get access to GeoIPCity.dat which is the full version.

And of course it can be done, i dont want to believe that it cant.

When visiting http://www.geoiptool.com/en/__ip_info/ it pinpoints my 
_exact_ city of living, not the ISP's.
It did not even ask me to allow a geop ip javascript to run it present 
sit instantly.


So, it certainly is possible if only one can find the correct database 
to use.


So, my question now is, if there is some way we can get an accurate Geo 
City database.


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Νικόλας

Στις 13/7/2013 1:07 πμ, ο/η MRAB έγραψε:


Have you considered that your ISP might be in the same city as you?

According to geoiptool, my ISP is near Leeds, UK, but the important
point is that _I'm not_.



My ISP is in Athens and i live in Thessaloníki and it returned back 
Thessaloníki not Athens, which it was accurate for me.


I dont know why it was not accurate for the other members here.
And of course if you are using a proxy then the GeoIP tool has no way of 
telling the real location of the visitor but the proxy's location in stead.


Also in another page which it asked me if i allow it to run a javascipt 
Geo app and i replied positively it gave me my exact city and street 
number too!


So many sites can identify accurately the correct city and even street 
some times, so there must be a way.


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Νικόλας

Στις 13/7/2013 2:04 πμ, ο/η Dennis Lee Bieber έγραψε:

On Sat, 13 Jul 2013 02:47:38 +1000, Chris Angelico ros...@gmail.com
declaimed the following:



Oh, and just for laughs, I tried a few of my recent mobile IP
addresses in the GeoIP lookup. All of them quoted Melbourne someplace,
some in the CBD and some out in the suburbs, but all vastly wrong, and
places I haven't been. But I'd never expect it to be accurate on
those.


Well... the MaxMind demo of my IP did get the proper metropolitan
area... But they list the ISP as ATT... My real ISP is Earthlink
(piggybacking on ATT DSL service).

The Lat/Long, however shows as

42.9634 -85.6681
whereas a recent GPS readout shows
42.9159 -85.5541

or 2m50s too far north, and 6m50s too far west.

Same website, accessed from my Blackberry phone, gave a result of
United States, NA and location 38 -97




I have read all your answer very carefully but i still need some way of 
getting it done.


All my Greek website visitors say they are from Europe/Athens which is 
the ISP's location and not user's homeland.


Well it worked for me but as many other told me it wasn't accurate for 
them too.


Please try this:  http://www.maxmind.com/en/geoip_demo

and tell me if maxmind's database can pippont you city's location.

Thank you.

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list