Small patch to 'check`for lwp-5

Hi everybody,

First of all: Thanks to the authors for making the tool and the
sourcecode available. It's a really great system, and it gives a nice
warm feeling to use an 'official' w3c-syntax checker (although the
results for my - usually weblint-proof - webpages were devastating).

I just installed the validator on a local system and ran into the
problem of not having a working libwww-perl-4 anymore, which check uses
for fetching files (using 'get').

Unfortunately, the output-format of the http-request/response-chain has
changed a little in 'lwp-request', lwp5's predecessor of 'get'.

Below you find a simple patch to the cgi-program 'check', which uses
lwp-request and parses its response. While at it, I've taken the liberty
of replacing the hardcoded URI for http://validator.w3.org with
$HTTP_HOST where it makes sense.

Enjoy, and feel free to comment or correct.

regards,
Bernhard Weisshuhn

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.7
diff -r1.7 check
24c24
< $abs_svc_uri	= "http://validator.w3.org/";
---
> $abs_svc_uri	= 'http://'.$ENV{'HTTP_HOST'}.'/';
28c28
< $grabber	= "/usr/local/lib/libwww-perl/get";
---
> $grabber	= "/usr/local/bin/lwp-request -Use";
318a319,322
>     if (/^([0-9][0-9][0-9])\s+(.*)/ ) {
> 	( $response, $message ) = ($1,$2);
>     }
>  

Received on Tuesday, 18 August 1998 15:16:45 UTC