Support also local W3C Validator installation based now at kashome.
[www.jankratochvil.net.git] / html-test.pl
index aa09b81..e5a4c4d 100755 (executable)
@@ -17,11 +17,14 @@ use URI::Escape;
 
 my $URL_BASE="http://".hostname_long().":7680";
 my $URL_VALIDATOR_BASE="http://validator.w3.org/check?uri=";
+my $URL_VALIDATOR_BASE_LOCAL="http://localhost/cgi-bin/check.cgi?uri=";
 
 
 my $opt_validate;
+my $opt_local;
 die if !GetOptions(
                "validate!",\$opt_validate,
+               "local!",\$opt_local,
                );
 
 my($first_pattern)=@ARGV;
@@ -50,7 +53,7 @@ My::ModPerlPm->list("sub"=>sub {
                }
        print ".";
        if ($opt_validate) {
-               $url=$URL_VALIDATOR_BASE.uri_escape($url);
+               $url=($opt_local ? $URL_VALIDATOR_BASE_LOCAL : $URL_VALIDATOR_BASE).uri_escape($url);
                }
        my $request=HTTP::Request->new("GET",$url);
        $request->header("Cache-control"=>"no-cache");