4 # Copyright 2009 Tamil s.a.r.l.
6 # This software is placed under the gnu General Public License, v2
7 # (http://www.gnu.org/licenses/gpl.html)
25 'verbose' => \$verbose,
31 pod2usage( -verbose => 2 );
37 my $context = new C4::Context( );
38 my $dbh = $context->dbh;
39 my $sth = $dbh->prepare(
40 "SELECT biblionumber FROM biblioitems WHERE url <> ''" );
42 while ( my ($biblionumber) = $sth->fetchrow ) {
43 my $record = GetMarcBiblio( $biblionumber );
44 next unless $record->field('856');
45 foreach my $field ( $record->field('856') ) {
46 my $url = $field->subfield('u');
48 $url = "$host/$url" unless $url =~ /^http/;
50 print "$biblionumber\t$url\tsucceed\n" if $verbose;
53 print "$biblionumber\t$url\tfailed\n";
61 check-url.pl - Check URLs from 856$u field.
67 =item check-url.pl [--verbose|--help] [--host=http://default.tld]
69 Scan all URL found in 856$u and display if ressources are available or not.
77 =item B<--host=http://default.tld>
79 Server host used when URL doesn't have one, ie doesn't begin with 'http:'.
80 For example, if --host=http://www.mylib.com, then when 856$u contains
81 'img/image.jpg', the url checked is: http://www.mylib.com/image.jpg'.
85 Output succeed URL checks with failed ones.