Created
August 9, 2011 01:13
-
-
Save myano/1133211 to your computer and use it in GitHub Desktop.
This file queries NOAA's severe weather alert ATOM feeds and displays each alert. One must provide the 6-digit FIPS code for the county. This code is pretty crude and was whipped up pretty quickly.
This file contains hidden or 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
#!/usr/bin/env python | |
import feedparser | |
loc = raw_input("Please input county code: ") | |
feed_url = 'http://alerts.weather.gov/cap/wwaatmget.php?x=%s' % (loc) | |
feed = feedparser.parse(feed_url) | |
for x in feed.entries: | |
a = x["title"] | |
if "There are no active watches, warnings or advisories" == a: | |
print "There are no active watches, warnings or advisories" | |
else: | |
print x["title"] | |
print x["summary"] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment