link-checker commit: Make markup and CSS validator URIs configurable.

changeset:   11:31f796d5589c
user:        ville
date:        Tue Mar 23 20:09:27 2004 +0000
files:       ChangeLog bin/checklink etc/checklink.conf
description:
Make markup and CSS validator URIs configurable.


diff -r b4e99b12fe10 -r 31f796d5589c ChangeLog
--- a/ChangeLog	Mon Mar 22 22:05:43 2004 +0000
+++ b/ChangeLog	Tue Mar 23 20:09:27 2004 +0000
@@ -1,3 +1,7 @@
+2004-03-23  Ville Skyttä  <ville.skytta@iki.fi>
+
+	* Make markup and CSS validator URIs configurable.
+
 2004-02-18  Ville Skyttä  <ville.skytta@iki.fi>
 
 	* First CPAN version.
diff -r b4e99b12fe10 -r 31f796d5589c bin/checklink
--- a/bin/checklink	Mon Mar 22 22:05:43 2004 +0000
+++ b/bin/checklink	Tue Mar 23 20:09:27 2004 +0000
@@ -5,7 +5,7 @@
 # (c) 1999-2004 World Wide Web Consortium
 # based on Renaud Bruyeron's checklink.pl
 #
-# $Id: checklink,v 3.8 2004-03-22 22:05:43 ville Exp $
+# $Id: checklink,v 3.9 2004-03-23 20:09:27 ville Exp $
 #
 # This program is licensed under the W3C(r) Software License:
 #       http://www.w3.org/Consortium/Legal/copyright-software
@@ -88,7 +88,7 @@
   $PROGRAM       = 'W3C checklink';
   ($AGENT        = $PROGRAM) =~ s/\s+/-/g;
   $VERSION       = '3.9.1';
-  ($CVS_VERSION) = q$Revision: 3.8 $ =~ /(\d+[\d\.]*\.\d+)/;
+  ($CVS_VERSION) = q$Revision: 3.9 $ =~ /(\d+[\d\.]*\.\d+)/;
   $REVISION      = sprintf('version %s [%s] (c) 1999-2004 W3C',
                            $VERSION, $CVS_VERSION);
 
@@ -121,6 +121,12 @@
       my %config_opts =
         ( -ConfigFile  => $conffile,
           -SplitPolicy => 'equalsign',
+          -DefaultConfig => {
+            Markup_Validator_URI
+              => 'http://validator.w3.org/check?uri=%s',
+            CSS_Validator_URI
+              => 'http://jigsaw.w3.org/css-validator/validator?uri=%s',
+          },
         );
       %Cfg = Config::General->new(%config_opts)->getall();
     };
@@ -532,12 +538,13 @@
     if (! $Opts{Summary_Only}) {
       printf("<p>Go to <a href=\"#%s\">the results</a>.</p>\n",
              $result_anchor);
+      my $esc_uri = URI::Escape::uri_escape($absolute_uri, "^A-Za-z0-9.");
       printf("<p>For reliable link checking results, check
-<a href=\"check?uri=%s\">HTML Validity</a> first.  See also
-<a href=\"http://jigsaw.w3.org/css-validator/validator?uri=%s\">CSS Validity</a>.</p>
+<a href=\"%s\">HTML validity</a> first.  See also
+<a href=\"%s\">CSS validity</a>.</p>
 <p>Back to the <a href=\"checklink\">link checker</a>.</p>\n",
-             map{&encode(URI::Escape::uri_escape($absolute_uri,
-                                                 "^A-Za-z0-9."))}(1..2));
+             &encode(sprintf($Cfg{Markup_Validator_URI}, $esc_uri)),
+             &encode(sprintf($Cfg{CSS_Validator_URI}, $esc_uri)));
       print("<pre>\n");
     }
   }
diff -r b4e99b12fe10 -r 31f796d5589c etc/checklink.conf
--- a/etc/checklink.conf	Mon Mar 22 22:05:43 2004 +0000
+++ b/etc/checklink.conf	Tue Mar 23 20:09:27 2004 +0000
@@ -1,6 +1,6 @@
 #
 # Configuration file for the W3C Link Checker
-# $Id: checklink.conf,v 1.1 2004-03-22 21:39:16 ville Exp $
+# $Id: checklink.conf,v 1.2 2004-03-23 20:09:27 ville Exp $
 #
 # See Config::General(3) for the syntax; 'SplitPolicy' is 'equalsign' here.
 #
@@ -29,3 +29,14 @@
 # For example, the following would disallow private IP addresses regardless
 # of the mode:
 # Allow_Private_IPs = 0
+
+
+#
+# Markup_Validator_URI and CSS_Validator_URI are formatted URIs to the
+# respective validators.  The %s in these will be replaced with the full
+# "URI encoded" URI to the document being checked, and shown in the link
+# checker results view in the online/CGI version.
+#
+# Defaults:
+# Markup_Validator_URI: http://validator.w3.org/check?uri=%s
+# CSS_Validator_URI: http://jigsaw.w3.org/css-validator/validator?uri=%s

Received on Thursday, 5 August 2010 14:46:55 UTC