- Problem:
- Check the current Department of Homeland Security Terror Level from the command line.
- Solution:
- The front page for the Department of Homeland Security displays an image corresponding to the current Terror Level. wget the Homeland Security page and pipe it through a regular expression, grabbing the alt tag for that image.
Sample line: src="/homeland/images/threat/elevated.jpg" alt="Elevated" border="0" Parser: []$ wget -q -O - http://www.whitehouse.gov/homeland/ \ | perl -ne 'print "Terror Level is: \n" if /src=\"\/homeland\/images\/threat\/\w+.jpg\" alt=\"(\w+)\"/;'