url_get: a script to retrieve documents specified by their URL.

Written by Jack Lund <zippy@ccwf.cc.utexas.edu>.

From hget by: Oscar Nierstrasz <oscar@cui.unige.ch>.

Many many thanks to Stephane Bortzmeyer <bortzmeyer@cnam.cnam.fr>.

Installation:

Put the files url_get.pl URL.pl and ftplib.pl either into the system-wide
perl library (often /usr/local/lib/perl), or into a local directory,
and set PERLLIB to point to that directory. For example, I put the files
in ~/lib/perl/url_get, so I have the following in my .login file:

setenv PERLLIB $HOME/lib/perl/url_get

Next, put url_get in your PATH, and you're ready.

Usage:

url_get [-bdh] URL

where URL is a Uniform Resource Locator like those used by the World Wide
Web, and specifically by NCSA Mosaic (If you're not familiar with any
of these terms, you might consider looking at the WWW FAQ in
comp.infosystems.www).

Url_get will put the retrieved document into the standard output, so if
you want it saved to a file, you'll need to redirect stdout to a file (see
the examples below). HTTP and gopher protocols are fully supported; the
"file" and "news" protocols are supported but not fully tested. If someone
finds problems with them, please send me mail.

The options are as follows:

	b	when doing FTP retrieves, do so in binary mode

	h	when retrieving via HTTP, include the MIME header
		which HTTP 1.0 prepends to the document. By default,
		url_get leaves this off

	d	"debug" mode for HTTP retrieves. Directs the HTTP status
		messages and MIME header to stderr, while sending the
		body of the document to stdout

url_get also now sends any errors from the HTTP header to stderr, unless
the "-d" flag is specified.

Some examples:

1) url_get http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/NCSAMosaicHome.html

This will present the NCSA Mosaic home page on standard output (usually the
terminal).

2) url_get http://www.utexas.edu/uta-banner.gif > uta-banner.gif

This will save the UT seal graphic used in the UT Austin home page into
a file called uta-banner.gif

3) url_get -h http://www.utexas.edu/uta-banner.gif | metamail

This takes the UT seal graphic from the previous example, prepended with
the MIME header, and runs it through metamail (Metamail is a freeware
MIME viewing software package). This will display the graphic using whatever
viewer I have metamail set up to display with.

4) url_get gopher://mudhoney.micro.umn.edu/00/Gopher.FAQ > gopher_questions.txt

This will get the Gopher FAQ file from the UMN gopher and save it in a
file called gopher_questions.txt.

Common error:

Many people have problems starting up url_get on their systems because
one of the files, ftplib.pl, uses an include file called syscall.ph, which
they might not have on their system. If you are one of these people,
then I recommend removing the "require syscall.ph" line, and replacing
the syscall line (line 35 of ftplib.pl) with either the hardcoded name
of your system, or, perhaps, something else which will return the hostname.

Finally:

If you have any questions or bug reports, please send them to:
zippy@ccwf.cc.utexas.edu. I'll try to get to them as I have time.

--
Jack Lund                            "Reality is a slap in the face with
Graphics Services                     a cold, wet fish"
UT Austin Computation Center                            -Dave Kaiser
zippy@ccwf.cc.utexas.edu     www: http://pugsley.cc.utexas.edu/zippy.html
