C4::URL::Checker - base object for checking URL stored in Koha DB
use C4::URL::Checker; my $checker = C4::URL::Checker->new( ); $checker->{ host_default } = 'http://mylib.kohalibrary.com'; my $checked_urls = $checker->check_biblio( 123 ); foreach my $url ( @$checked_urls ) { print "url: ", $url->{ url }, "\n", "is_success: ", $url->{ is_success }, "\n", "status: ", $url->{ status }, "\n"; }
Create a URL Checker. The returned object can be used to set default host variable :
my $checker = C4::URL::Checker->new( ); $checker->{ host_default } = 'http://mylib.kohalibrary.com';
Check all URL from a biblio record. Returns a pointer to an array containing all URLs with checking for each of them.
my $checked_urls = $checker->check_biblio( 123 );
With 2 URLs, the returned array will look like that:
[ { 'url' => 'http://mylib.tamil.fr/img/62265_0055B.JPG', 'is_success' => 1, 'status' => 'ok' }, { 'url' => 'http://mylib.tamil.fr//img/62265_0055C.JPG', 'is_success' => 0, 'status' => '404 - Page not found' } ],
check-url.pl - Check URLs from 856$u field.
Scan all URLs found in 856$u of bib records and display if resources are available or not.
Server host used when URL doesn't have one, ie doesn't begin with 'http:'. For example, if --host=http://www.mylib.com, then when 856$u contains 'img/image.jpg', the url checked is: http://www.mylib.com/image.jpg'.
Outputs both successful and failed URLs.
Formats output in HTML. The result can be redirected to a file accessible by http. This way, it's possible to link directly to biblio record in edit mode. With this parameter --host-pro is required.
Server host used to link to biblio record editing page.
Print this help page.
Hey! The above document had some coding errors, which are explained below:
Non-ASCII character seen before =encoding in ' },'. Assuming UTF-8