<<

NAME

C4::URL::Checker - base object for checking URL stored in Koha DB

SYNOPSIS

 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";
 }

FUNCTIONS

new

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_biblio

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'
    }
  ],

NAME

check-url.pl - Check URLs from 856$u field.

USAGE

check-url.pl [--verbose|--help] [--agent=agent-string] [--host=http://default.tld]

Scan all URLs found in 856$u of bib records and display if resources are available or not. This script is deprecated. You should rather use check-url-quick.pl.

PARAMETERS

--host=http://default.tld

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'.

--verbose|-v

Outputs both successful and failed URLs.

--html

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.

--host-pro=http://koha-pro.tld

Server host used to link to biblio record editing page.

--agent=agent-string

Change default libwww user-agent string to custom. Some sites do not like libwww user-agent and return false 40x failure codes, so this allows Koha to report itself as Koha, or a browser.

--timeout=15

Timeout for fetching URLs. By default 15 seconds.

--help|-h

Print this help page.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 37:

Non-ASCII character seen before =encoding in ' },'. Assuming UTF-8

<<