Last change
on this file since 238 was 2, checked in by Rick van der Zwet, 15 years ago |
Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)
|
-
Property svn:executable
set to
*
|
File size:
660 bytes
|
Rev | Line | |
---|
[2] | 1 | #!/usr/bin/env perl
|
---|
| 2 | do "common.pl";
|
---|
| 3 |
|
---|
| 4 | @code_404;
|
---|
| 5 | @hits;
|
---|
| 6 | %seen;
|
---|
| 7 |
|
---|
| 8 | open(FILE,$file);
|
---|
| 9 | while(<FILE>) {
|
---|
| 10 | /\S*\ \S*\ \S*\ \S*\ \S*\ \S*\ (\S*)\ \S*\ (\S*)\ /;
|
---|
| 11 | $url = $1;
|
---|
| 12 | $status = $2;
|
---|
| 13 | $hits[$status]++;
|
---|
| 14 | if ( $status == 404 ) {
|
---|
| 15 | if ( not exists $seen{$url} ) {
|
---|
| 16 | $seen{$url} = $status;
|
---|
| 17 | push(@code_404, $url);
|
---|
| 18 | }
|
---|
| 19 | };
|
---|
| 20 | $status_code{$url} = $status;
|
---|
| 21 | }
|
---|
| 22 | close(FILE);
|
---|
| 23 |
|
---|
| 24 | $total_hits = 0;
|
---|
| 25 | ($total_hits+= $_ ) for @hits;
|
---|
| 26 |
|
---|
| 27 | print "404/total hits: $hits[404]/$total_hits ",
|
---|
| 28 | percent($hits[404],$total_hits), "\n";
|
---|
| 29 | print "Different 404 url's: ", scalar(@code_404), " ",
|
---|
| 30 | percent(scalar(@code_404),$hits[404]), "\n";
|
---|
| 31 | exit(0);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.