Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/azeroero_learning-progress.json
T

1 line
1.5 KiB
JSON

{"repo": "azeroero/learning-progress", "files": {"5.py": {"afcbd3f5908f15d3e45e5940e98c2d5c27c5bb50": {"t": 1785674578.2359738, "n": 1326, "h": "8ecb593c8ea82253", "c": "import urllib.request, urllib.parse, urllib.error\nimport json\nimport ssl\n\napi_key = False\n# If you have a Google Places API key, enter it here\n# api_key = 'AIzaSy___IDByT70'\n# https://developers.google.com/maps/documentation/geocoding/intro\n\nif api_key is False:\n api_key = 42\n serviceurl = 'http://py4e-data.dr-chuck.net/json?'\n#else :\n #serviceurl = 'https://maps.googleapis.com/maps/api/geocode/json?'\n\n# Ignore SSL certificate errors\nctx = ssl.create_default_context()\nctx.check_hostname = False\nctx.verify_mode = ssl.CERT_NONE\n\nwhile True:\n address = input('Enter location: ')\n if len(address) < 1: break\n\n parms = dict()\n parms['address'] = address\n if api_key is not False: parms['key'] = api_key\n url = serviceurl + urllib.parse.urlencode(parms)\n\n print('Retrieving', url)\n uh = urllib.request.urlopen(url, context=ctx)\n data = uh.read().decode()\n print('Retrieved', len(data), 'characters')\n\n try:\n js = json.loads(data)\n except:\n js = None\n\n if not js or 'status' not in js or js['status'] != 'OK':\n print('==== Failure To Retrieve ====')\n print(data)\n continue\n\n #print(json.dumps(js, indent=4))\n place = js['results'][0]['place_id']\n print(place)\n #location = js['results'][0]['formatted_address']\n #print(location)\n"}}}}