source: liacs/ccs/op3/exists.pl@ 145

Last change on this file since 145 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
RevLine 
[2]1#!/usr/bin/env perl
2do "common.pl";
3
4@code_404;
5@hits;
6%seen;
7
8open(FILE,$file);
9while(<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}
22close(FILE);
23
24$total_hits = 0;
25($total_hits+= $_ ) for @hits;
26
27print "404/total hits: $hits[404]/$total_hits ",
28percent($hits[404],$total_hits), "\n";
29print "Different 404 url's: ", scalar(@code_404), " ",
30percent(scalar(@code_404),$hits[404]), "\n";
31exit(0);
Note: See TracBrowser for help on using the repository browser.