Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions apps/detailedmetar/detailedmetar.star
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/rawmetar/raw_metar.star
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down