Re: URL return

Rick Troth (troth@rice.edu)
Tue, 13 Dec 1994 19:52:19 +0100

> Is there an app that, when given a URL, returns the source document?

Yes! I see that several have been mentioned.

This is exactly what 'webcat' is for. Syntax is

webcat [-i | -a] URL

where URL is the Uniform Resource Locator of the
object to be retrieved. The UNIX version will canonicalize
plain text or image. (other canonicalizations are possible
on other platforms, but there doesn't seem to be much agreement
about how to send that over TCP)

> There must have been something like that already developed and I
> really do not want to re-invent the wheel.

I would have hoped that something like webcat would be the
basic building block for a wide range of pipelined WWW applications.
It's just a slap-together thing now. I wanted to use the CERN
library, but the learning curve on that was too steep for the
time I had available.

Webcat has one interesting feature that I *really* like
to which some have objected. The URL can be a local file.
If the URL is a local file, and that local file is a sym-link
that fails to resolve locally, the link is used as the URL.
What happens is that system open() is called first, iff that fails
then webcat tries a readlink(), iff that succeeds then webcat uses
the link reference as a URL, if neither open() nor readlink() work
then webcat treats the command-line argument as the URL.

This means you can

ls -l http://www.cern.ch/ CERN

and then later

webcat -a CERN | your_favourite_browser

> Thanks.
>
> Jim Meritt

A slightly out-of-date version of webcat is at

http://ftp.rice.edu/~troth/software/webcat.tar

-- 
Rick Troth, Rice University, Information Systems