Last active
December 23, 2016 19:57
-
-
Save jakekara/4ba60d06f8902118c8e521bbc6a92327 to your computer and use it in GitHub Desktop.
get FAA airport status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def status_url(code): | |
return "http://services.faa.gov/airport/status/" + code + "?format=application/json" | |
def get_status(code): | |
r = requests.get(status_url(code)) | |
if r.status_code != 200: | |
raise Exception ("Error fetching status for airport " + code+ ": <Status: " + str(r.status_code) + ">") | |
return r.json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment