| 1 | =head1 NAME | ||
| 2 | |||
| 3 | WWW::Link::Reporter::URI - Report link URIs only | ||
| 4 | |||
| 5 | =head1 SYNOPSIS | ||
| 6 | |||
| 7 | use WWW::Link; | ||
| 8 | use WWW::Link::Reporter::URI; | ||
| 9 | |||
| 10 | $link=new WWW::Link; | ||
| 11 | |||
| 12 | #over time do things to the link ...... | ||
| 13 | |||
| 14 | $reporter = new WWW::Link::Reporter::URI | ||
| 15 | $reporter->examine($link) | ||
| 16 | |||
| 17 | =head1 DESCRIPTION | ||
| 18 | |||
| 19 | This is a very simple class derived from WWW::Link::Reporter which | ||
| 20 | simply prints the URIs of each link reported. By chosing the correct | ||
| 21 | reports this is then good for generating output for use in scripts | ||
| 22 | etc. | ||
| 23 | |||
| 24 | =cut | ||
| 25 | |||
| 26 | package WWW::Link::Reporter::URI; | ||
| 27 | 1 | $REVISION=q$Revision: 1.1 $ ; $VERSION = sprintf ( "%d.%02d", $REVISION =~ /(\d+).(\d+)/ ); | |
| 28 | |||
| 29 | 1 | @ISA = qw(WWW::Link::Reporter); | |
| 30 | |||
| 31 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 32 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 33 | |||
| 34 | 1 | ▶ | use WWW::Link::Reporter; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 35 | |||
| 36 | 1 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=2 SCAR=16.4
| |||
| 37 | 1 | foreach my $rep ( qw( broken okay damaged not_checked disallowed | |
| 38 | unsupported redirections suggestions page_list ) ) { | ||
| 39 | 9 | do { | |
| 40 | 0 | ▶ | eval <<EOF; |
|
Subroutine
broken: not called CC=1 SCAR=6.5
Subroutine
damaged: not called CC=1 SCAR=6.5
Subroutine
disallowed: not called CC=1 SCAR=6.5
Subroutine
not_checked: not called CC=1 SCAR=6.5
Subroutine
okay: not called CC=1 SCAR=6.5
Subroutine
page_list: not called CC=1 SCAR=6.5
Subroutine
redirections: not called CC=1 SCAR=6.5
Subroutine
suggestions: not called CC=1 SCAR=6.5
Subroutine
unsupported: not called CC=1 SCAR=6.5
Pod
documented
Pod
documented
Pod
documented
Pod
documented
Pod
documented
Pod
undocumented
Pod
undocumented
Pod
undocumented
Pod
documented
| |||
| 41 | sub $rep { | ||
| 42 | my \$self=shift; | ||
| 43 | my \$link=shift; | ||
| 44 | my \$url=\$link->url(); | ||
| 45 | print "\$url\n"; | ||
| 46 | } | ||
| 47 | EOF | ||
| 48 | }; | ||
| 49 | } | ||
| 50 | } | ||
| 51 | |||
| 52 | 0 | ▶ | sub not_found { |
|
Subroutine
not_found: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 53 | 0 | my $self=shift; | |
| 54 | 0 | my $url=shift; | |
| 55 | 0 | print STDERR "Link $url is not in the database.\n"; | |
| 56 | } | ||
| 57 | |||
| 58 | 0 | ▶ | sub unknown { |
|
Subroutine
unknown: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 59 | 0 | my $self=shift; | |
| 60 | 0 | my $link=shift; | |
| 61 | 0 | my $url=$link->url(); | |
| 62 | 0 | print STDERR "Link $url has unknown status (error?).\n"; | |
| 63 | } | ||
| 64 | |||
| 65 | 1 | 1; | |
| 66 | |||
| 67 | |||
| 68 | |||