#!/usr/athena/bin/perl

while(<>){
    chop;
    ($t, $u, @n) = split;
    $name{$u} = join(" ", @n);
    $mod{$u} = $t;
}

print "<h1 aling=center>Home Pages modified within the past week</h1>\n";
print "<ul>\n";
$lastd = 0;
foreach $x (sort {$mod{$a} <=> $mod{$b}} keys %mod){
    $d = $mod{$x};
    if(($lastd < 86400) && ($d > 86400)){
	print "<hr>\n";
    }
    if($d > 1209600){
	$e = int($d/604800)." weeks";
    }
    elsif($d > 86400){
	$e = 1+int($d/86400)." days ago";
    }
    else{
	$e = "yesterday";
    }
    if($d < 604800){
	print "<li><a href=$x>$name{$x}</a> ($e)\n" unless $mod{$x} < 0;
    }
    $lastd = $d;
}
print "</ul>\n";
print <<FOOTER;
<hr>

<a href="index.html"><img src="images/main.gif"
alt="[www.mit.edu home page]"
width=50 height=50 border=0></a>
<a href="home-pages.html"><img src="images/home.gif"
alt="[personal home pages]"
width=50 height=50 border=0></a>
<a href="activities/"><img src="images/groups.gif"
alt="[activities and clubs]"
width=50 height=50 border=0></a>
<a href="services.html"><img src="images/services.gif"
alt="[gateways and services]"
width=50 height=50 border=0></a>
<a href="content.html"><img src="images/docs.gif"
alt="[local content]"
width=50 height=50 border=0></a>
<a href="help/"><img src="images/help.gif"
alt="[help resources]"
width=50 height=50 border=0></a>

<hr>

FOOTER
