Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import googlemaps
- import requests
- import json
- api_key = "AIzaSyD_LJB0-Bl9V3Q-shOUaTZ188ajn19UYRI"
- gm = googlemaps.Client(key=api_key)
- city = input("Please enter a city: ")
- geocode_result = gm.geocode(city)[0]
- print("The Latitude and Longitude are now posted to your webhook." )
- coordinates = geocode_result['geometry']['location']
- print(coordinates)
- url = 'https://www.datazar.com/workspace/datasets/json/f9badcabb-6a52-45f5-94fa-1007f4677fc1'
- requests.post(url, json=coordinates)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement