Update locationdata.py

This commit is contained in:
SpudGunMan
2024-06-19 22:26:34 -07:00
parent f575d255ef
commit d8fc7975d0
+3
View File
@@ -33,6 +33,9 @@ def where_am_i(lat=0, lon=0):
return whereIam
def get_tide(lat=0, lon=0):
station_id = ""
if lat == 0 and lon == 0:
return "no location data"
station_lookup_url = "https://api.tidesandcurrents.noaa.gov/mdapi/prod/webapi/tidepredstations.json?lat=" + str(lat) + "&lon=" + str(lon) + "&radius=50"
station_data = requests.get(station_lookup_url, timeout=5)
if(station_data.ok):