import urllib2
import json

try:
    response = urllib2.urlopen('http://ip-api.com/json')
    data = json.load(response)
    
    if data['status'] == 'success':
        lat = data['lat']
        lon = data['lon']
        print 'Approximate location:'
        print 'Latitude:', lat
        print 'Longitude:', lon
        print 'Google Maps: http://www.google.com/maps/place/{},{}'.format(lat, lon)
    else:
        print 'Error fetching location:', data['message']
except urllib2.URLError as e:
    print 'Network error:', e
except Exception as e:
    print 'Unexpected error:', e
