diff --git a/apps/detailedmetar/detailedmetar.star b/apps/detailedmetar/detailedmetar.star index 360995e87a..a18ef7cef1 100644 --- a/apps/detailedmetar/detailedmetar.star +++ b/apps/detailedmetar/detailedmetar.star @@ -22,7 +22,7 @@ def main(config): f_selector = config.bool("fahrenheit_temperatures", False) # API URL - apiURL = "https://www.aviationweather.gov/cgi-bin/data/metar.php?ids=" + airport + "&format=json" + apiURL = "https://aviationweather.gov/api/data/metar?ids=" + airport + "&format=json" # Store cahces by airport. That way if two users are pulling the same airport's METAR it is only fetched once. cacheName = "metar/" + airport @@ -482,8 +482,9 @@ def getWindSpeed(decodedMetar): windSpeedText = "Calm" # Set wind gust variable - if decodedMetar["wgst"] != None: - windGust = int(decodedMetar["wgst"]) + windGust = decodedMetar.get("wgst") + if windGust != None: + windGust = int(windGust) windSpeedText = str(windSpeed) + "-" + str(windGust) + "kts" # Wind speed color determinations diff --git a/apps/rawmetar/raw_metar.star b/apps/rawmetar/raw_metar.star index ad86beb507..ed98c86db9 100644 --- a/apps/rawmetar/raw_metar.star +++ b/apps/rawmetar/raw_metar.star @@ -22,7 +22,7 @@ def main(config): ), ) - response = http.get("https://www.aviationweather.gov/cgi-bin/data/metar.php?ids={}".format(station_id)) + response = http.get("https://aviationweather.gov/api/data/metar?ids={}".format(station_id)) content = response.body() if not content: