Advertisement
pymanny

Untitled

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