“Scraping” content from web pages means trying to guess at where the content is and making it usable. It’s what the NetFlix plug-in for MT does. After installing the NetFlix plug-in, I decided to adapt it to scrape the Homeland Security Advisory System page over at the Department of Homeland Security.
Unlike the Buffalo weather information over there on the left, which can be updated dynamically by just clicking the “Updated” link, this update is included each time Moveable Type regenerates the index page. It was a fun way to avoid all of the things I need to do this weekend. Click on more, below, if you want to install it on your Moveable Type powered page, and be a part of generating irrational fear.
This is a simple plugin and it is easy to set up.
1. Download the plugin(dhs.pl). FTP it to your site and place it in the directory called “plugins” wherever your Moveable Type is installed. If you find no “plugins” directory in the directory where you find mt.cgi, make it (and chmod both it and the dhs.pl script to 777).
2. Download the images. Easiest is probably to right-click these and use them, or make your own, using the same titles. (Update: like these!)
Place these wherever your index page for MT is.
3. Somewhere in the main template, include something like this:
<img height="40" width="125" border="0" src="<$MTdhsLevel$>">
And you are good to go!