Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1.  
  2. import googlemaps
  3.  
  4. import requests
  5.  
  6. import json
  7.  
  8. api_key = "AIzaSyD_LJB0-Bl9V3Q-shOUaTZ188ajn19UYRI"
  9. gm = googlemaps.Client(key=api_key)
  10.  
  11. city = input("Please enter a city: ")
  12.  
  13. geocode_result = gm.geocode(city)[0]
  14.  
  15. print("The Latitude and Longitude are now posted to your webhook." )
  16. coordinates = geocode_result['geometry']['location']
  17. print(coordinates)
  18.  
  19. url = 'https://www.datazar.com/workspace/datasets/json/f9badcabb-6a52-45f5-94fa-1007f4677fc1'
  20.  
  21. requests.post(url, json=coordinates)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement