#!/usr/local/bin/perl 


use Time::Local;


print "Content-type:text/html\n\n";



$jdir = "/data/MAIN/kirk.is/journal";


opendir(DIR,"$jdir") or print "can't open $jdir";
while(defined($file= readdir(DIR))) {
    if($file =~ /\.txt$/){
            push @files, $file;

    }
}
closedir(DIR);



foreach $file (@files){
    open(READ,"$jdir/$file") || print "Can't open $jdir/$file $!";
    $title{$file} = <READ>;
    close READ;
}


print<<__EOQ__;
<head>

<title>kisrael.com all titles</title>
</head>
<body bgcolor="white">
<center>
<FONT FACE="Arial" COLOR="black" size=+2><a href="/">kisrael.com</a>: all titles, sorted alphabetically</font>
</center><br>
<TABLE  CELLSPACING=0 border=0>

__EOQ__

foreach $entry (sort {$title{$a} cmp $title{$b}}keys %title){
   
    $link = $entry;

    $link=~ s/.txt$//;
    if($title{$entry} eq $last){
#        $dup = "<i>DUP!</i>";
    } else {
#	$dup = "";
    }

    print<<__EOQ__;
<tr><td  bgcolor="#CCCCCC">
<FONT FACE="Arial" COLOR="black" size=1>$link </font>
</td>
<td>


<a href="/viewblog/?date=$link"><FONT FACE="Arial" COLOR="black"><B>$title{$entry}</b> $dup</font></a>
<br>

</td></tr>
<tr><td>&nbsp;</td></tr>
__EOQ__

    $last = $title{$entry};
}





print<<__EOQ__
</table>
__EOQ__
