#!/local/bin/perl # showdead.pl Daniel MacKay Daniel.MacKay@Dal.Ca # 990922 DEM Scan the log from a "htdig -s" run and produce pages listing # all the dead links for your web managers to browse. $prefix = "/local/www/search/deadlinks/" ; $title = "Dead links found on 990924 dig\n"; while (<>) { chop; #print "$_|\n"; s/\s*$//; if (m/^Not found:\s+(.*) Ref: (.*)$/) { ($bad,$ref) = ($1,$2) ; $key = $ref ; # print "$_\n" ; $key =~ s/^http:\/\///; $key =~ s/\/.*$//; push(@bad,"$key\t$ref\t$bad") ; } } ; open (SERV,">$prefix/index.html") || die "can't open dead index file" ; chmod (644,"$prefix/index.html"); print SERV "<$title\n"; print SERV "

$title

\n"; close OUT ; print SERV "
  • $count bad links on $okey\n" ; $count=0; print "Now writing to $key\n" ; open (OUT,">$prefix/bad_$key.html") || die "can't open file for $key" ; chmod (644,"$prefix/bad_$key.html"); print OUT "Bad links on $key\n"; print OUT "

    $title
    $key

    \n"; close OUT; print SERV "\n" ; close SERV ; -- Daniel.MacKay@Dal.Ca Network Operations Centre Manager 902 494-danm Dalhousie University, Halifax, Nova Scotia, Canada. ------------------------------------ To unsubscribe from the htdig mailing list, send a message to htdig@htdig.org containing the single word unsubscribe in the SUBJECT of the message.