Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: UNSURE 0.219 X-Spam-Level: ** X-Spam-Evidence: '*H*': 0.58; '*S*': 0.02; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'api': 0.11; 'browsers.': 0.16; 'kern': 0.16; 'lie,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'underlying': 0.16; 'wizard': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'all,': 0.19; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'interpret': 0.24; 'script.': 0.24; '(or': 0.24; 'script': 0.25; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'robert': 0.30; 'getting': 0.31; 'cgi': 0.31; 'yes.': 0.31; 'allows': 0.31; 'subject:from': 0.34; 'no,': 0.35; 'but': 0.35; 'there': 0.35; 'application': 0.37; 'too': 0.37; 'server': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'address.': 0.39; 'received:org': 0.40; 'how': 0.40; 'new': 0.61; 'facebook': 0.61; "you're": 0.61; 'back': 0.62; 'information': 0.63; 'choose': 0.64; 'our': 0.64; 'different': 0.65; 'relatively': 0.65; 'world': 0.66; 'city': 0.66; 'believe': 0.68; '8bit%:92': 0.71; '8bit%:100': 0.72; 'url:info': 0.73; 'jul': 0.74; 'client-side': 0.84; 'eco': 0.84; 'geolocation': 0.84; 'location?': 0.84; 'skip:\xef 10': 0.84; 'subject:Location': 0.84; 'terrible': 0.84; 'cast': 0.91; 'received:86': 0.91; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Robert Kern Subject: Re: Geo Location extracted from visitors ip address Date: Sat, 06 Jul 2013 11:21:27 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: cpc2-cmbg17-2-0-cust347.5-4.cable.virginmedia.com User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 In-Reply-To: X-Mailman-Approved-At: Mon, 08 Jul 2013 11:22:35 +0200 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373275356 news.xs4all.nl 15902 [2001:888:2000:d::a6]:48018 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50136 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 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