#! /usr/local/bin/perl #-------------------------------------------------------------------# $log = "./log.csv"; #-------------------------------------------------------------------# print "Content-type: text/html\n\n"; if (!open(DB,"$log")) { &error(1); } @lines = ; $accesses = @lines; close(DB); foreach $line (@lines) { ($hour,$ref,$rh,$hua) = split(/\,/,$line); if ($hour ne '') { $hours{($hour)[0]}++; $h++; } if ($ref ne '') { $refs{($ref)[0]}++; $i++; } if ($rh ne '') { $rhs{($rh)[0]}++; $j++; } if ($hua ne '') { $huas{($hua)[0]}++; $k++; } } print "WebACCESS\n"; print "
Make your own free website on Tripod.com
\n"; print "

WebACCESS

\n"; print "総サンプル数:最新$accessesアクセス

\n"; print "
\n"; print "

どこからリンクされているか?

\n"; print "サンプル数:$i

\n"; print "\n"; print "\n"; foreach (sort { $refs{$b} <=> $refs{$a} } keys %refs) { if ($refs{$_} >= 3) { print "\n"; $percent_refs = (int(10000 * ($refs{$_} / $i)) / 100); print "\n"; print "\n"; } } print "
リンク元件数割合
$_$refs{$_}$percent_refs\%

(2件未満略)

\n"; print "

\n"; print "
\n"; print "

利用ホストはどこか?

\n"; print "サンプル数:$j

\n"; print "\n"; print "\n"; foreach (sort { $rhs{$b} <=> $rhs{$a} } keys %rhs) { if ($rhs{$_} >= 5) { print "\n"; $percent_rhs = (int(10000 * ($rhs{$_} / $j)) / 100); print "\n"; print "\n"; } } print "
リモートホスト件数割合
$_$rhs{$_}$percent_rhs\%

(5件未満略)

\n"; print "

\n"; print "

利用ブラウザは何か?

\n"; print "サンプル数:$k

\n"; print "\n"; print "\n"; foreach (sort { $huas{$b} <=> $huas{$a} } keys %huas) { print "\n"; $percent_huas = (int(10000 * ($huas{$_} / $k)) / 100); print "\n"; print "\n"; } print "
ブラウザ名件数割合
$_$huas{$_}$percent_huas\%

\n"; print ''; print 'MSIEのMozilla-compatibleの場合は、MSIEとして集計しています.

' . "\n"; print ''; print "

\n"; print "
\n"; print "

時間単位のアクセス調査

\n"; print "\n"; print "\n"; foreach (sort keys %hours) { print "\n"; $percent_hours = (int(10000 * ($hours{$_} / $h)) / 100); $kome = '■' x $percent_hours; print "\n"; print "\n"; } print "
時間帯件数目安
$_$hours{$_}$kome

\n"; print "

\n"; print "

WebACCESS is Free.

\n"; print "\n";