[NBLUG/talk] Current Alert Status
Kyle Rankin
greenfly at greenfly.net
Mon Apr 21 10:40:03 PDT 2003
On Mon, Apr 21, 2003 at 12:30:54PM -0500, Warren Raquel wrote:
> I need to find a way to pull the current terror alert status nation-wide
> and by state into a program to show what the current alert status is at
> any point in time. Preferably via perl, anyone have any ideas?
...
I set up an app or two to do this about a month or two back, (that's what
happens when you mix boredom and caffeine).
Anyway, the key shell command I used was the following:
wget -q -O - http://www.whitehouse.gov/homeland/ | perl -ne 'print "Terror
Level is: $1\n" if /src=\"\/homeland\/images\/threat\/\w+.jpg\"
alt=\"(\w+)\"/;'
(pardon the leaning toothpicks)
I also coded up a quick Perl/Tk app to do the same. I called it "Tk
Terrar!" and you can grab it from here:
http://greenfly.org/tk_terrar2.tar.gz
You will need to modify it a bit, since I didn't really code it for anyone
but myself, and it makes a few assumptions (mostly that it will be in my
/home/greenfly/ directory) but that's stuff that's easily changed.
Here's an example screenshot showing it in action:
http://greenfly.org/terror2.jpg
--
Kyle Rankin (greenfly)
http://greenfly.org
More information about the talk
mailing list