function get_last_blathed_file($who)
{
// returns last file that $who blathed to, indexed by page name
// get html page for $who
if($_GET['edition']=="red")
{
$edition = "/edition=red";
} else {
$edition = "";
}
$who_blathes = file("http://blather.newdream.net/cgi-bin/blather".$edition."?who;name=".urlencode($who));
$lines = Array();
foreach($who_blathes as $line)
{
if(strpos($line,''));
// and the name of the page
$page_name = substr($line,strrpos($line,'/')+1);
$page_name = substr($page_name,0,strpos($page_name,'.html'));
// assign the array space and return.
return $lines[$page_name] = $line;
}
}
}
if(!empty($_GET['who']))
{
// get last file that $who blathed to
$who_blathes = get_last_blathed_file($_GET['who']);
echo "Last file that ".$_GET['who']." appears on, in ".$_GET['edition'].", is $who_blathes
";
}
?>