home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.sunet.sepub/pictures
/
2014.11.ftp.sunet.se-pictures.tar
/
ftp.sunet.se
/
pub
/
pictures
/
ACiD-artpacks
/
www
/
mirrors
/
acheron
/
cgi-bin
/
stats.cgi
< prev
next >
Wrap
Text File
|
1999-02-28
|
12KB
|
321 lines
#!/usr/bin/perl
# declare variables
$current_ip = "nothing";
## december banners
$artpacks_acid1_dec1998_counter = 0;
$acheron_acid1_dec1998_counter = 0;
$hirez_acid1_dec1998_counter = 0;
## jan 1999 banners
$artpacks_acid1_jan_counter = 0;
$acheron_acid1_jan_counter = 0;
$hirez_acid1_jan_counter = 0;
$acheron_hirez1_jan_counter = 0;
$acheron_element_jan_counter = 0;
$hirez_element_jan_counter = 0;
$acheron_element2_jan_counter = 0;
$hirez_element2_jan_counter = 0;
## feb 1999 banners
$acheron_hirez1_feb_counter = 0;
$acheron_element_feb_counter = 0;
$hirez_element_feb_counter = 0;
$acheron_element2_feb_counter = 0;
$hirez_element2_feb_counter = 0;
$acheron_vtag_feb_counter = 0;
## mar 1999 banners
$acheron_hirez1_mar_counter = 0;
$acheron_element_mar_counter = 0;
$hirez_element_mar_counter = 0;
$acheron_element2_mar_counter = 0;
$hirez_element2_mar_counter = 0;
$acheron_vtag_mar_counter = 0;
## today counters
$acid_today = 0;
$hirez_today = 0;
$element_today = 0;
$element2_today = 0;
$vtag_today = 0;
## impression counters
$total_jan_hirez_impressions = 0;
$total_jan_element_impressions = 0;
$total_jan_element2_impressions = 0;
$total_jan_vtag_impressions = 0;
$total_feb_hirez_impressions = 0;
$total_feb_element_impressions = 0;
$total_feb_element2_impressions = 0;
$total_feb_vtag_impressions = 0;
$total_mar_hirez_impressions = 0;
$total_mar_element_impressions = 0;
$total_mar_element2_impressions = 0;
$total_mar_vtag_impressions = 0;
$filename = "logfile.txt";
# call initial functions
&Analyse_file;
#########################################################################
sub Analyse_file {
open (LOGFILE, "<$filename") || die "Could not open or find $filename\n";
foreach $line (<LOGFILE>) {
($banner, $pipe, $day_name, $month, $day_no, $time, $year, $pipe2, $ip, $pipe3, $host) = split(' ', $line);
$todays_dat = "" .gmtime(time). "";
($mday_name, $mmonth, $mday_no, $mtime, $myear) = split(' ', $todays_dat);
$todays_date = "$mday_no $mmonth $myear";
## today's banner click-throughs ####
if (("$mday_no $mmonth $myear" eq "$day_no $month $year") && ($current_ip ne $ip)) {
if ($banner eq "acidgear") { $acid_today++; }
if ($banner eq "hirez") { $hirez_today++; }
if ($banner eq "element") { $element_today++; }
if ($banner eq "element2") { $element2_today++; }
if ($banner eq "vtag") { $vtag_today++; }
}
## jan 1999 ####
if ($banner eq "acidgear" && $month eq "Jan" && $current_ip ne $ip) {
$acid1_jan_counter++;
if ($host eq "artpacks.acid.org") {$artpacks_acid1_jan_counter++;}
if ($host eq "www.acheron.org") {$acheron_acid1_jan_counter++;}
if ($host eq "www.hirez.org") {$hirez_acid1_jan_counter++;}
}
if ($banner eq "hirez" && $month eq "Jan" && $current_ip ne $ip) {
$hirez1_jan_counter++;
if ($host eq "www.acheron.org") {$acheron_hirez1_jan_counter++;}
}
if ($banner eq "element" && $month eq "Jan" && $current_ip ne $ip) {
$element_jan_counter++;
if ($host eq "www.acheron.org") {$acheron_element_jan_counter++;}
if ($host eq "www.hirez.org") {$hirez_element_jan_counter++;}
}
if ($banner eq "element2" && $month eq "Jan" && $current_ip ne $ip) {
$element2_jan_counter++;
if ($host eq "www.acheron.org") {$acheron_element2_jan_counter++;}
if ($host eq "www.hirez.org") {$hirez_element2_jan_counter++;}
}
## february
if ($banner eq "hirez" && $month eq "Feb" && $current_ip ne $ip) {
$hirez1_feb_counter++;
if ($host eq "www.acheron.org") {$acheron_hirez1_feb_counter++;}
}
if ($banner eq "vtag" && $month eq "Feb" && $current_ip ne $ip) {
$vtag_feb_counter++;
if ($host eq "www.acheron.org") {$acheron_vtag_feb_counter++;}
}
if ($banner eq "element" && $month eq "Feb" && $current_ip ne $ip) {
$element_feb_counter++;
if ($host eq "www.acheron.org") {$acheron_element_feb_counter++;}
if ($host eq "www.hirez.org") {$hirez_element_feb_counter++;}
}
if ($banner eq "element2" && $month eq "Feb" && $current_ip ne $ip) {
$element2_feb_counter++;
if ($host eq "www.acheron.org") {$acheron_element2_feb_counter++;}
if ($host eq "www.hirez.org") {$hirez_element2_feb_counter++;}
}
## march
if ($banner eq "hirez" && $month eq "Mar" && $current_ip ne $ip) {
$hirez1_mar_counter++;
if ($host eq "www.acheron.org") {$acheron_hirez1_mar_counter++;}
}
if ($banner eq "vtag" && $month eq "Mar" && $current_ip ne $ip) {
$vtag_mar_counter++;
if ($host eq "www.acheron.org") {$acheron_vtag_mar_counter++;}
}
if ($banner eq "element" && $month eq "Mar" && $current_ip ne $ip) {
$element_mar_counter++;
if ($host eq "www.acheron.org") {$acheron_element_mar_counter++;}
if ($host eq "www.hirez.org") {$hirez_element_mar_counter++;}
}
if ($banner eq "element2" && $month eq "Mar" && $current_ip ne $ip) {
$element2_mar_counter++;
if ($host eq "www.acheron.org") {$acheron_element2_mar_counter++;}
if ($host eq "www.hirez.org") {$hirez_element2_mar_counter++;}
}
$current_ip = $ip;
}
close LOGFILE;
## analyse exposures
open (EXPFILE, "<exposures.txt") || die "Could not open or find $filename\n";
foreach $line (<EXPFILE>) {
($banner, $pipe, $day_name, $month, $day_no, $time, $year, $pipe2, $ip, $pipe3, $host) = split(' ', $line);
if ($month eq "Jan") {
if ($banner eq "hirez") {$total_jan_hirez_impressions++;}
if ($banner eq "element") {$total_jan_element_impressions++;}
if ($banner eq "element2") {$total_jan_element2_impressions++;}
if ($banner eq "vtag") {$total_jan_vtag_impressions++;}
}
if ($month eq "Feb") {
if ($banner eq "hirez") {$total_feb_hirez_impressions++;}
if ($banner eq "element") {$total_feb_element_impressions++;}
if ($banner eq "element2") {$total_feb_element2_impressions++;}
if ($banner eq "vtag") {$total_feb_vtag_impressions++;}
}
if ($month eq "Mar") {
if ($banner eq "hirez") {$total_mar_hirez_impressions++;}
if ($banner eq "element") {$total_mar_element_impressions++;}
if ($banner eq "element2") {$total_mar_element2_impressions++;}
if ($banner eq "vtag") {$total_mar_vtag_impressions++;}
}
}
close EXPFILE;
print &Header;
print &Top("test");
$output = "STDOUT";
print $output "<font size=4><b>Banner Statistics as of $todays_date</b></font><br>\n";
print $output "Number of semi-unique click-throughs for all hosted banners<p>\n";
## today
print $output "<font size=3><b>Today:</font> <font size=2>($todays_date)</font></b><p>\n";
print $output "<table width=300 cellpadding=0 cellspacing=0>\n";
print $output "<tr><td>Hirez.org:</td><td>$hirez_today</td></tr>\n";
print $output "<tr><td>Element Design:</td><td>$element_today</td></tr>\n";
print $output "<tr><td>Element Design #2:</td><td>$element2_today</td></tr>\n";
print $output "<tr><td>VTAG:</td><td>$vtag_today</td></tr></table><p>\n";
## mar 99
print $output "<p>\n";
print $output "<font size=3><b>March:</B></font><p>\n";
print $output "<p><B>Hirez.org: $hirez1_mar_counter clicks</b> ($total_mar_hirez_impressions impressions)<br>\n";
print $output "<img src=/images/ads/hirez.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: $acheron_hirez1_mar_counter)</font>\n";
print $output "<p><B>Element Design: $element_mar_counter clicks</B> ($total_mar_element_impressions impressions)<br>\n";
print $output "<img src=/images/ads/element.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: $acheron_element_mar_counter) (hirez.org: $hirez_element_mar_counter)</font>\n";
print $output "<p><B>Element Design #2: $element2_mar_counter clicks</B> ($total_mar_element2_impressions impressions)<br>\n";
print $output "<img src=/images/ads/element2.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: $acheron_element2_mar_counter) (hirez.org: $hirez_element2_mar_counter)</font>\n";
print $output "<p><B>VTAG: $vtag_mar_counter clicks</B> ($total_mar_vtag_impressions impressions)<br>\n";
print $output "<img src=/images/ads/vtagban.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: $acheron_vtag_mar_counter)</font>\n";
## feb 99
print $output "<p>\n";
print $output "<font size=3><b>February:</B></font><p>\n";
print $output "<p><B>Hirez.org: 14 clicks</b> (1331 impressions)<br>\n";
print $output "<img src=/images/ads/hirez.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: 14)</font>\n";
print $output "<p><B>Element Design: 17 clicks</B> (7544 impressions)<br>\n";
print $output "<img src=/images/ads/element.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: 11) (hirez.org: 6)</font>\n";
print $output "<p><B>Element Design #2: 11 clicks</B> (4867 impressions)<br>\n";
print $output "<img src=/images/ads/element2.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: 5) (hirez.org: 6)</font>\n";
print $output "<p><B>VTAG: 24 clicks</B> (1420 impressions)<br>\n";
print $output "<img src=/images/ads/vtagban.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: 24)</font>\n";
## january 99
print $output "<p>\n";
print $output "<font size=3><b>January 1999:</b></font><p>\n";
print $output "<B>Acid gear: 244 clicks</B> (n/a impressions)<br>\n";
print $output "<img src=/images/ads/acidban.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: 58) (hirez.org: 35) (artpacks: 151)</font>\n";
print $output "<p><B>Hirez.org: 27 clicks</B> (40 impressions)<br>\n";
print $output "<img src=/images/ads/hirez.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: 27)</font>\n";
print $output "<p><B>Element Design: 14 clicks</B> (193 impressions)<br>\n";
print $output "<img src=/images/ads/element.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: 8) (hirez.org: 6)</font>\n";
print $output "<p><B>Element Design #2: 2 clicks</B> (166 impressions)<br>\n";
print $output "<img src=/images/ads/element2.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: 2) (hirez.org: 0)</font>\n";
## december 98
print $output "<p><font size=3><b>December 1998:</b></font><p>\n";
print $output "Acid gear: 24<br>\n";
print $output "<img src=/images/ads/acidban.gif width=468 height=60 alt=Viewing banner><br>\n";
print $output "<font size=1>(acheron.org: $acheron_acid1_dec1998_counter) (hirez.org: $hirez_acid1_dec1998_counter) (artpacks: $artpacks_acid1_dec1998_counter)</font>\n";
print &Bottom;
}
#########################################################################
#_____Module Returns the Output Document Type______#
sub Header
{
return "Content-type: text/html\n\n";
}
#_____Module Returns the Output Document Head_______#
sub Top
{
my ($title) = @_;
return <<"ENDPRINT";
<HTML>
<HEAD>
<TITLE>acheron.org // admin / banner statistics</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<BODY link="#FFCC00" vlink="#FF9900" alink="#FFFFFF" text="#cccccc" BGCOLOR="#000000">
<div align="center">
<table border="0" width="640" align="center" cellspacing="0" cellpadding="0">
<tr>
<td width="640">
<p><font size="2" face="Arial, Helvetica, sans-serif">
ENDPRINT
}
#_____Module Returns the Output Document Bottom______#
sub Bottom
{
return "</td></tr></table></div></BODY></HTML>\n";
}