Skip to content

Instantly share code, notes, and snippets.

@wohali
Last active April 23, 2017 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wohali/f9c13f3f0c6cd7be56f610dcd0b34ac5 to your computer and use it in GitHub Desktop.
Save wohali/f9c13f3f0c6cd7be56f610dcd0b34ac5 to your computer and use it in GitHub Desktop.
for geekmoon METAR/TAF support
# http://avwx.rest/documentation has all the details
import requests
STATION='CYYZ'
SPEECH=True
r = requests.get("http://avwx.rest/api/metar/" + STATION + "?options=info,speech")
metar = r.json()
if SPEECH:
print (metar["Speech"])
else:
print (metar["Raw-Report"] + ' ' + metar["Remarks"])
# http://avwx.rest/documentation has all the details
import requests
STATION='CYYZ'
r = requests.get("http://avwx.rest/api/taf/" + STATION)
taf = r.json()
print (taf["Raw-Report"] + ' ' + taf["Remarks"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment