#!/usr/bin/perl -w
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
#NAME
#  showlost - List the ABC sites that have disappeared
#
#SYNOPSIS
#  showlost 
#
#REQUIRES
#
#DESCRIPTION
#  After a search run has been done, it's fairly common that some sites  that
#  used  to  have  ABC  tunes  will  have produced none this time.  When this
#  happens, the sites hst/example.com file will be moved to  del/example.com,
#  and will "disappear" from results.  This program shows the sites that used
#  to have ABC tunes but don't now.  It does this by listing the contents  of
#  the  http/  directory,  which should all be subdirectories named after the
#  host, and listing the hostnames that no longer have a hst/ file.
#
#OPTIONS
#
#EXAMPLES
#
#FILES
#
#BUGS
#
#SEE ALSO
#
#AUTHOR
#  John Chambers <jc@trillian.mit.edu>
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

$| = 1;
$exitstat = 0;
($P = $0) =~ s".*/"";
$V = $ENV{"V_$P"} || $ENV{"D_$P"} || 1;	# Verbose level.

@allhosts = `ls http`;
for $h (@allhosts) {
	$h =~ s/[\r\s]$//;
	if (-f "hst/$h") {
		print "Host: $h\n" if $V>2;
	} elsif (-f "del/$h") {
		print "GONE: $h\n" if $V>0;
	} else {
		print "Gone: $h\n" if $V>1;
	}
}

print "$P: Exit with status $exitstat.\n" if $V>1;
exit $exitstat;

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
