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-16 Thread Joel Goldstick
On Tue, Jul 16, 2013 at 3:43 PM, Νικόλας ni...@superhost.gr wrote:

 Στις 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.htmlhttp://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-listhttp://mail.python.org/mailman/listinfo/python-list


Learn about ajax


-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-16 Thread alex23

On 16/07/2013 12:48 PM, Michael Torrie wrote:

I've posted a link to detailed information on this no less than three
times, yet Nikos has not read any of it, sadly.


Just a quick reminder for everyone:

Ferrous Cranus is utterly impervious to reason, persuasion and new 
ideas, and when engaged in battle he will not yield an inch in his 
position regardless of its hopelessness. Though his thrusts are 
decisively repulsed, his arguments crushed in every detail and his 
defenses demolished beyond repair he will remount the same attack again 
and again with only the slightest variation in tactics.


http://www.politicsforum.org/images/flame_warriors/flame_62.php

--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-16 Thread Chris Angelico
On Wed, Jul 17, 2013 at 10:51 AM, Dennis Lee Bieber
wlfr...@ix.netcom.com wrote:
 On Tue, 16 Jul 2013 22:43:35 +0300, ??? ni...@superhost.gr declaimed
 the following:


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?

 Using plain CGI is going to be painful -- since /everything/ is 
 handled
 a whole new page request. You would have to handle session cookies, etc.

 Your index.html would attempt to run the JavaScript (note that some
 users may have JavaScript turned off -- how will you handle that), if it
 gets information it would have to do a GET index2.html?lat=xxx?long=yyy
 or something similar, which will result in a new page load on the user --
 hopefully with a cookie set so you know NOT to run the geolocation code on
 subsequent pages.

 AJAX is a process to allow JavaScript on the browser to interact with 
 a
 server (using XML data structures), and likely use DOM operations in the
 browser (and the last time I did something on this nature, I had to have
 different code for Internet Explorer vs Firefox, and don't know of
 Chrome/Opera share one of the others calls) to make changes on the web page
 without doing a full submit/render operation

AJAX changes the client end, but not the server (well, you might
change the server's output format to make it easier, but it's not
essential). So you *can* still use the CGI that you're familiar with.

For reference, Firefox/Chrome/Opera/Safari are all pretty much
identical for this sort of work; and the recent IEs (9, I think, and
10) are following them too. There are trivial differences, but for the
basics, it's possible to support IE8+, Chrome, Firefox back as far as
the Iceweasel from Debian Squeeze (I think that's Ff 3.5), and so on,
all from the same code. No per-browser checks required.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-15 Thread Joel Goldstick
On Fri, Jul 12, 2013 at 7:04 PM, Dennis Lee Bieber wlfr...@ix.netcom.comwrote:

 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
 --
 Wulfraed Dennis Lee Bieber AF6VN
 wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/

 --
 http://mail.python.org/mailman/listinfo/python-list


Speaking more from a political perspective, an important aspect of the
internet is that if you are a publisher who doesn't require registration to
read what you post, your readers are free to be more or less anonymous.
This is a good thing in many ways.  If you have a service that requires
some sort of sign up, then you can require knowing things about them
(location, etc).  If you want to know where your readers are, you need to
make arrangements with their ISPs to get that information, since in many
cases the ISP has a physical link to your machine.  But why should they
provide that to you?  After all you are not their customer.

It might be fun to know, but the repercussions are serious.


-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-15 Thread Michael Torrie
On 07/12/2013 10:32 AM, Νικόλας wrote:
 So, my question now is, if there is some way we can get an accurate Geo 
 City database.

As has been said pretty much by every other poster, there is no way to
do get an accurate location database.  Period.

The databases that do exist were built by hand, and also guessed at
based on routing information.  The best you can really do is region, or
country, and even that fails sometimes.

If you want to know a visitor's city you should ask them using the new
browser location apis available to javascript.

http://diveintohtml5.info/geolocation.html

Since IPs can be dynamic, sometimes even assigned across a region,
there's no way to accurately map ip addresses to a city with the
reliability that you seem to want.  Google is pretty accurate because
they've spent a lot of time building up their own database, and also
convincing users to reveal their locations to them.  Unless you do the
same thing, you have to just get by with what others have provided for you.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-15 Thread 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).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-15 Thread Wayne Werner

On Sat, 13 Jul 2013, Νικόλας 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?


If you bothered doing something as simple as read the Wikipedia article on
Geolocation, you could answer this question yourself: Evidently you, and your 
friends have things like cookies, or some other helps that identify your

location, which is why your addresses are close.

-W-- 
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-15 Thread Michael Torrie
On 07/15/2013 06:34 PM, Dennis Lee Bieber wrote:
 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.

   You don't... The phone company knows where their towers are, THEY do
 the triangulation based on signal strength from cell phones on their
 network, and they provide that position to the phone. The phone can then
 use that data to respond to applications running ON the phone that request
 location information using the phone's OS API (which is different for an
 Android phone vs Blackberry vs Apple).

I've posted a link to detailed information on this no less than three
times, yet Nikos has not read any of it, sadly.
-- 
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-14 Thread Tim Chase
On 2013-07-13 16:57, Michael Torrie wrote:
 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. 

And the good browsers give the user the option to disclose this
information or not (and, as I mentioned elsewhere on this thread,
even lie about where you are such as with the Geolocater plugin[1] for
FF).

Some of us value the modicum of privacy that we receive by not being
locatable by IP address.

-tkc

[1]
https://addons.mozilla.org/en-us/firefox/addon/geolocater/
-- 
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 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.

ChrisA
-- 
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 Lele Gaifax
Νικόλας ni...@superhost.gr writes:

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

Read the answers you got. What is *impossible* is *exactly and
precisely* find the geographical location of your machine, just using an
IP database like what you are doing, i.e. without your local machine
cooperating in the process (for example, by providing the numbers taken
from your local machine's GPS device).

What you are using is just some kind of heuristic, it's not an exact
science: each ISP is generally assigned a bunch of IPs which it manages
in some way, reserving some of them as *static IP* (that is, the same IP
is assigned to the same contractor, always), and assigning the other on
demand, like a DHCP server would do in a intranet. Think to the latter:
do you think it is possible to exactly locate in which room every
wireless notebook that travels inside your big house is at any given
time? Hint: no, you cannot, the best you can say is that each notebook
may be within a “sphere” of radius 50mt (just making up a number, it
obviously depend on the wireless signal power, and eventually on the
presence of wireless repeaters...).

Maybe you did provide your exact street address when signed the contract
with your ISP, but now ask yourself: would you be happy if your ISP
gives that kind of information to whomever may ask for it (in the
specific case, a geolocation service like maxmind.com)?

ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Roy Smith
In article krqqqt$eol$4...@news.grnet.gr,
 ÉΪÉ«É»όλας ni...@superhost.gr wrote:

 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.

At Songza, we purchase the MaxMind database for doing geolocation based 
on IP address.  This is how we enforce our content licenses which only 
allow us to stream music to the US and Canada.  We also use it to target 
specific features (or advertising) to specific cities or other 
geographic areas within the US and Canada.

That being said, we understand that it is only an approximate solution.  
It is useful, but not perfect.  If you go to the MaxMind web site, you 
will see they have a range of products, at different prices, which 
promise various levels of accuracy and error rates.  But none of them, 
for any amount of money, offers resolution down to the street address 
and 0% error rate.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Chris Angelico
On Sun, Jul 14, 2013 at 2:54 AM, Dennis Lee Bieber
wlfr...@ix.netcom.com wrote:
 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.

And even that is no guarantee. I have two connections, one static IP,
the other dynamic. The static one fails geolocation by a greater
distance than the other. No, there's no way to be sure.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Roy Smith
In article mailman.4680.1373734493.3114.python-l...@python.org,
 Dennis Lee Bieber wlfr...@ix.netcom.com wrote:

 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.

And even then, it can be wrong.  When I worked for EMC, they 
(apparently, from what I could see) back-hauled internet connections for 
all their offices to Hopkinton, MA where they had one central ISP 
connection, via NAT.  So, when I sat at my desk in White Plains, NY and 
went to Moviephone's web site, I was conveniently shown what all the 
theaters in the Hopkinton area were playing that day.  Ditto for the 
weather.

Not to mention that some IP addresses move.  People use mobile devices 
in cars, busses, trains, planes, boats, etc.  Not to mention somewhat 
more esoteric places like the ISS.
-- 
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 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.
-- 
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 Roy Smith
In article krs5uc$6ht$1...@news.grnet.gr,
 ÉΪÉ«É»όλας ni...@superhost.gr wrote:

  There are lots of interesting (and superior) ways to do geolocation
  other than looking up IP addresses.  Here's a few:
 . [...]
  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?

Unfortunately, no.  I don't do front-end development.  I am aware of the 
technologies, but do not know the details of how you access them on any 
particular device.  I would start with the API docs for the device you 
are interested in and look for location services.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Wayne Werner

On Sat, 13 Jul 2013, Νικόλας wrote:
But it works for me, How can it be impossible and worked for me at the 
same time?


2 + 2 = 4
2 + 6 = 8???

Why can't I make 2 and 6 equal 4? It worked for 2, so I know it's not
impossible! I don't care what everyone says, I was able to make one case work
so obviously I juat need to figure out how to make it work!


Allegorically,
W-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread 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

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Chris Angelico
On Sun, Jul 14, 2013 at 4:28 AM, Νικόλας ni...@superhost.gr wrote:
 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.

So every ISP in the world needs to warp its business to your
convenience. Are you at all thinking about what you're asking for,
here?

ChrisA
-- 
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


Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread 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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Dave Angel

On 07/12/2013 10:18 AM, Νικόλας wrote:

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


   SNIP



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


Either it wasn't successful, or it's not the package you thought.  There 
are lots of things you might have downloaded, but since you give no 
details...





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/



Sure, and as long as you don't mind it being 1000 miles off, you too can 
claim to do it too.  When I go to that site, the little pin is in 
Kansas, which is 1100 miles from where I live on the east coast of the US.




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

Perhaps this is being done by giving  longitude and latitude?


Or by reading the mind of the programmer.

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.


--
DaveA

--
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 Grant Edwards
On 2013-07-12, ?? ni...@superhost.gr wrote:

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

You can't reliably do that.

 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.

Believe what you want.

 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 you've reached your conclusion on a sample size of one?

-- 
Grant Edwards   grant.b.edwardsYow! I'm encased in the
  at   lining of a pure pork
  gmail.comsausage!!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Chris Angelico
On Sat, Jul 13, 2013 at 1:32 AM, Dave Angel da...@davea.name wrote:

 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/


 Sure, and as long as you don't mind it being 1000 miles off, you too can
 claim to do it too.  When I go to that site, the little pin is in Kansas,
 which is 1100 miles from where I live on the east coast of the US.

I have two IPs at this house, not counting the ones I could get off
mobile connections (which are valid probably anywhere in the state,
maybe further afield). One of them is plotted fairly accurately (not
more than a couple of kilometers wrong), but the other is listed at
Elizabeth and Bourke in the CBD... which is half an hour's train
journey away from me. And the one that was wrong was the one that's
actually an official static IP address (as opposed to a technically
dynamic but hasn't changed for a couple of years address).

Obligatory XKCD link: http://xkcd.com/713/

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Chris Angelico
On Sat, Jul 13, 2013 at 2:38 AM, Grant Edwards invalid@invalid.invalid wrote:
 On 2013-07-12, ?? ni...@superhost.gr wrote:
 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 you've reached your conclusion on a sample size of one?

This is Nikos. He doesn't read responses properly, doesn't do his
research, and has (by his own admission) an iron head that doesn't let
information cross it lightly. Yes, he reached his conclusion on a
sample size of one.

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.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Joel Goldstick
On Fri, Jul 12, 2013 at 11:52 AM, Νικόλας ni...@superhost.gr wrote:

 Στις 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/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.


 Nikos, this is the point where you (again) loose credibility on this
list.  You asked this question about how to find the location where someone
is browsing your site from.  You got several answers.  The bottom line is
that you can't know that location unless the browsing machine does its own
geo location (think cell phones) or the user has provided his location via
some form.

So, now, a week or two later you come back with the same question, as if it
hasn't already been answered -- but you give it a 'red herring' kind of
twist.  As I understand it, you found a new module that you think will do
something that all parties answering this question before explained that
this is not possible.  And you switch up to say why can't I load this
thing?.  Well, I don't why you can't load it, but I don't want to help
because it doesn't help you solve your stated problem.  Your stated problem
is done.  move on.




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




-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Ian Kelly
On Fri, Jul 12, 2013 at 10:32 AM, Νικόλας ni...@superhost.gr wrote:

 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.

Try this:

1) Go to http://incloak.com (or any other free web proxy site).
2) Paste in the URL http://www.geoiptool.com and press Enter
3) See where it thinks you are now.

When I tried it, it placed me on the wrong side of the Atlantic Ocean.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Terry Reedy

On 7/12/2013 1:19 PM, Ian Kelly wrote:


Try this:

1) Go to http://incloak.com (or any other free web proxy site).
2) Paste in the URL http://www.geoiptool.com and press Enter
3) See where it thinks you are now.

When I tried it, it placed me on the wrong side of the Atlantic Ocean.


Me to. Thanks for the link.

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread MRAB

On 12/07/2013 17:32, Νικόλας wrote:


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.


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_.


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.



--
http://mail.python.org/mailman/listinfo/python-list


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Chris Angelico
On Sat, Jul 13, 2013 at 9:04 AM, Dennis Lee Bieber
wlfr...@ix.netcom.com wrote:
 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

When you try to place a visitor geographically by IP address, the only
thing you can be absolutely 100% certain of is which RIR they're at
(proxies aside - you're just testing the proxy rather than the
ultimate origin). Country is also highly likely to be right, though
not certain (I've never known it to be wrong, but I've never been able
to confirm what happens with some of the small European countries -
for all I know they could share ISPs and netblocks). Anything tighter
than that is goign to be pretty hit-and-miss. But I have to say, it's
improved a lot over the years. Back in the early 2000s - say, about 8
years ago, I think - I was playing with this sort of technology, and
it placed me in Sydney. That's one state away, lots of rivalry
separating us (friendly rivalry, of course; in a country that's doing
its best to kill us all, we can't afford to really hate each other),
and roughly 750-1000km wrong by distance (depending on how you measure
- most people don't put an odometer on a crow). So at least now it
gets within the same degree of latitude and longitude... most of the
time.

ChrisA
-- 
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


Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread 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
-- 
http://mail.python.org/mailman/listinfo/python-list