-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
Use the Key Parameter.
import urllib
import json
serviceurl = "http://py4e-data.dr-chuck.net/json?"
while True:
address = raw_input("Enter location: ")
if len(address) < 1 : break
url = serviceurl + urllib.urlencode({'sensor':'false','address':address,'key':42})
print 'Retrieving',url
uh =urllib.urlopen(url)
data = uh.read()
print 'Retrived',len(data),'characters'
try: js = json.loads(str(data))
except: js = None
if 'status' not in js or js['status'] != 'OK':
print '==== Failure To Retrieve ===='
print data
continue
placeid = js["results"][0]['place_id']
print "Place id",placeid
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels