via Paul Walsh and Google Code Blog – google.loader.ClientLocation tells you the city, country, region, longitude and latitude based on the IP address of the client.
The gist is:
curl -i -s http://www.google.com/jsapi | grep ClientLocation
google.loader.ClientLocation = {"latitude":53.333,"longitude":-6.249,"address":
{"city":"Dublin","region":"Dublin City","country":"Ireland","country_code":"IE"}};
Use http://www.google.com/jsapi and you get location information for free.
Nice!.