Geo Location extracted from visitors ip address

Robert Kern robert.kern at gmail.com
Sat Jul 6 06:21:27 EDT 2013


On 2013-07-06 09:41, Νίκος Gr33k wrote:
> Στις 6/7/2013 11:30 πμ, ο/η Chris Angelico έγραψε:
>> On Sat, Jul 6, 2013 at 6:01 PM, ����� Gr33k <nikos at superhost.gr> wrote:
>>> Is there any way to pinpoint the visitor's exact location?
>>
>> Yes. You ask them to fill in a shipping address. They may still lie,
>> or they may choose to not answer, but that's the best you're going to
>> achieve without getting a wizard to cast Scrying.
>
> No, no registration requirements.
>
> you know when i go to maps.google.com its always find my exact city of location
> and not just say Europe/Athens.
>
> and twitter and facebook too both of them pinpoint my _exact_ location.
>
> How are they able to do it? We need the same way.

They use client-side JavaScript. This is a relatively new API available in most, 
but not all, recent browsers. This information will not be available to your CGI 
script. You will have to generate HTML with the proper JavaScript to get the 
geolocation (if the user allows it) and then send it back to your server through 
a different CGI script (or web application endpoint).

   http://diveintohtml5.info/geolocation.html

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list