Skip to content

Instantly share code, notes, and snippets.

@myano
Created August 9, 2011 01:13
Show Gist options
  • Save myano/1133211 to your computer and use it in GitHub Desktop.
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.
#!/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"]
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment