#!/usr/local/bin/perl # $Id: refstats.pl,v 1.3 1997/06/29 02:03:34 elkner Exp $ # refstats: Program to create statistics about URL's on a WWW server and # their refering URL's. # Its is a modified version of Benjamin Franz' RefStats 1.1.1 # ( http://www.netimages.com/~snowhare/utilities/ ) # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A # PARTICULAR PURPOSE. # # I offer it to the public domain and I ask, however, that this paragraph # and my name be retained in any modified versions of the file you may # make, and that you notify me of any improvements you make to the code. # # Use of this software in any way or in any form, source or binary, # is not allowed in any country which prohibits disclaimers of any # implied warranties of merchantability or fitness for a particular # purpose or any disclaimers of a similar nature. # # IN NO EVENT SHALL I BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, # SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE # USE OF THIS SOFTWARE AND ITS DOCUMENTATION (INCLUDING, BUT NOT # LIMITED TO, LOST PROFITS) EVEN IF I HAVE BEEN ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE require "ctime.pl"; require "getopts.pl"; $version="RefStats 1.1.2-E"; # Location and name of the decompression program # (usually '/usr/bin/zcat', '/usr/local/bin/zcat', # '/usr/bin/gzip -c' or '/usr/local/bin/gzip -c') $Zcat="/usr/local/bin/zcat"; $refscounter=0; $filecounter=0; $newsection="
\n
\n
",
"Generated using $version from ",
"",
"Jens Elkner, \n",
"a modified version of \n",
"",
"RefStats 1.1.1\n",
"\n";
close(OUT);
if ($OutputFile ne '-') {
rename "$OutputFile.$$", "$OutputFile";
}
}
sub bytargetthenhits {
($targeta)=($a=~m#^(.+)\s#o);
($targetb)=($b=~m#^(.+)\s#o);
$inequality=($targeta cmp $targetb);
if ($inequality) {
$inequality;
} else {
$TargetCounter{$b}<=>$TargetCounter{$a};
}
}
sub GetLastModTime {
while (