#!/usr/bin/perl # stats.cgi # By Meryll Larkin, written January 2004, last update August 13, 2006 # March 2006 update: added regex to keep urls out of plaform column # August 13, 2006 update to speed up the Web page display and to put # parsing where it belongs (in the input spy.cgi sheet) # the platform parsing has been taken out of this file and # put into the input page: spy.cgi # Also, a column has been added to all_stat table of the # alwanza_site MySQL database to contain the # parsed platform values, in addition to the # full ENV{HTTP_USER_AGENT} string, so no info has been lost. use strict; use DBI; use SPYDB; use CGI qw(:standard); use SPYCOUNT; my $SPYDB = SPYDB->new; my $COUNT = SPYCOUNT->new; my $debug = 0; my $backgroundColor = "#ff6600"; my $textColor="black"; my $hed_back="#ffff00"; # header background color my $table_back="white"; # table cell background color my $pg = new CGI(); my $url= $pg->url(-path_info=>1); my $Default_URL = url; my $selected_order = param('sort') || "COUNT"; $selected_order .= " " . param('order'); print "Content-type: text/html\n\n"; print "\nAlwanza Web Statistics\n"; print qq| |; print "\n\n"; my $direction; if ($selected_order =~ /DESC/) { $direction = "ASC"; } else { $direction = "DESC"; } print qq|
|; print qq||; my $end_range = $COUNT->get_count(); my $begin_range = $end_range - 151; my @records = $SPYDB->get_visitors($selected_order, $begin_range); my ($record, $count, $day, $user, $origin, $cookie, $platform); foreach $record (@records) { $count = $record->[0]; $day = $record->[1]; $user = $record->[2]; $platform = $record->[3]; $origin = $record->[4]; $cookie = $record->[5]; if ((not defined $cookie) || ($cookie !~ /\w/) || ($cookie eq "NULL")) { $cookie = "\ \;"; } if ((not defined $origin) || ($origin !~ /\w/) || ($origin eq "NULL")) { $origin = "\ \;"; } print qq| |; } print "\n

Who visits Alwanza?  I wanted to know.  I've received emails from strangers who found me through search engines.  I have friends who visit and revisit irregularly.  The search engine-bots make their periodic rounds.....

This page is for demonstration purposes only.  I do not use the information I've collected and I do not sell it.  If you see your IP address here and would prefer that it not be displayed, send me an email and I'll remove your IP address from this display.

If you are interested in the workings behind this page, I have an explanation here:  alwanza.com/bells/statsLAMP.html

Count Day Time (Pacific time) from IP on Platform Origin Cookie
$count $day $user $platform $origin $cookie
\n"; print "
\n"; print "\n


\n"; print "\n\n\n\n"; # **********************************************