def GetFromGoogleLocAPI():
  h = httplib2.Http(tempfile.gettempdir(), timeout=10)
  url = 'http://www.google.com/loc/json'
  post_data = {'request_address': 'true', 'version': '1.1.0', 'source': 'gloc'}
  cvb, icerik = h.request(url, 'POST', simplejson.dumps(post_data))
  try:
    data = simplejson.loads(icerik)['location']
    return {
        'region_name': data['address'].get('region'),
        'country_name': data['address'].get('country'),
        'country_code': data['address'].get('country_code'),
        'city': data['address'].get('city'),
        'latitude': data['latitude'],
        'longitude': data['longitude'],
        'source': 'gloc'
    }
  except:
    print '* basarisiz: %s (icerik: %s)' % (util.GetLastExceptionString(), icerik)
    return {}


GetFromGoogleLocAPI()
>> GetFromGoogleLocAPI()
{'city': 'Istanbul Province', 'region_name': None, 'source': 'gloc', 'longitude': 28.97696, 'latitude': 42.00527, 'country_code': 'TR', 'country_name': 'Turkey'}
>>>