#!/usr/athena/bin/perl

use DB_File;
tie(%history, DB_File, "/mit/mkgray/.netscape/history.dat");
require "ctime.pl";
while(1){
for $x (keys %history){
    chop($y=$x);
    next if ($y =~ /\.gif$/i);
    next if ($y =~ /\.jpg$/i);
    $v = $history{$x};
    $l = length($v);
    $allbits = "";
    for $foo (0..11){
	$bar = ord(substr($v, $foo, 1));
	$allbits .= "/ " if(($foo%4 ) == 0);
	$allbits .= "$bar ";
    }
    $a = ord(substr($v, 0, 1));
    $b = ord(substr($v, 1, 1));
    $c = ord(substr($v, 2, 1));
    $d = ord(substr($v, 3, 1));
    $e = ord(substr($v, 12, 1));
    $f = ord(substr($v, 13, 1));
    $g = ord(substr($v, 14, 1));
    $h = ord(substr($v, 15, 1));
    $t = (256*256*256*$d);
    $t += (256*256*$c);
    $t += (256*$b)+$a;
    $when = &ctime($t);
    if($t > (time()-60)){
	print "$x\n$when\n" unless ($seen{$x} == $t);
	$seen{$x} = $t;
    }
#    print "$x\n$allbits\n$when\n";
}
    for $u (keys %seen){
	delete $seen{$u} if($seen{$u} < (time()-60));
    }
}
