?

Log in

No account? Create an account

Previous Entry | Next Entry

Yes, I'm using this as a link notebook

http://www.victorisdead.com/luna/terror/

<?

// It's PEANUT BUTTER TERROR TIME!
// Uses the Department of Homeland Security feed
// to display threat colour in a dancing banana.
// by luna@no.spam.thx.victorisdead.com, 12.22.03
// props to jons of wroth.org !


function xmlstart ($p, $n, $attr) { global $adv; $adv = $attr['CONDITION']; }
function
xmlend ($p, $n) { }

$img = array ('LOW'      => 'green',
              
'GUARDED'  => 'blue',
              
'ELEVATED' => 'yellow',
              
'HIGH'     => 'orange',
              
'SEVERE'   => 'red');

$levelxml = trim(implode('', @file('http://www.dhs.gov/dhspublic/getAdvisoryCondition')));
$adv = null;

if (
strlen($levelxml) > 0)
{
   
$parser = xml_parser_create();
   
xml_set_element_handler($parser, "xmlstart", "xmlend");
   
xml_parse($parser, $levelxml, true);
}

$file = '/home/luna/www.victorisdead.com/luna/terror/'.$img[$adv].'.gif';

header ('Content-Type: image/gif');
header ('Content-Length: '.filesize($file));

fpassthru(@fopen($file, 'rb'));
exit;

?>

Current terror threat is ELEVATED. Add me to your site:
<img src="http://victorisdead.com/luna/terror.php" alt="terror alert banana" />
[but always link back.]

actual size is 33x35.
terror alert banana