Subject: Grab-a-Site
From: [email-masked] (Sergey Okhapkin)

4 Feb 1997 03:20:45 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: "'Gnu-Win32'" <[email-masked]>,
        "'Igor Gavrushkin'"
	 <[email-masked]>
Encoding: 96 TEXT, 121 UUENCODE
X-MS-Attachment: Grab-A-Site-1.0.tcl 0 00-00-1980 00:00
Original-Sender: [email-masked]

Hi!

Someone in this mailing list asks about a tool to download pages/trees from 
a web site to local disk. I wrote this tool as a Tcl script. Here is a 
readme file and script itself.

------------Grab-A-Site-1.0.tcl.README

			Grab-A-Site v1.0
			~~~~~~~~~~~~~~~~

1. What is it?

  This is a Tcl script to download ("grab") entire WWW site or selected 
tree.
You need Tcl 7.6 and later to run this scripts. The earlier versions of Tcl
interpreter will not work due to usage of "file delete" command. This 
script
was succesfully tested with Tcl 7.6 and 8.0a2 on Win32 (Windows NT 4.0) and
Linux platforms. Check availability of this packages for your platform on
http://www.sunlabs.com/research/tcl. Script requires http 1.0 package from 
Tcl
8.0a2 source distribution (file lib/http.tcl). WARNING: this file is missed 
in
Tcl/Tk 8.0a2 binary distribution for Windows.

2. How to use it?

  Run "tclsh Grab-A-Site-1.0.tcl URL [download directory]",
or (on UNIX systems) "chmod +x Grab-A-Site-1.0.tcl" and run
"Grab-A-Site-1.0.tcl URL [download directory]",

where:
  URL - full url of requested file or directory tree. "/" is required after
        directory name!
  Download direcrory - where to download (default to current directory). 
Script
        automatically creates directory tree corresponding to server's 
tree.

Examples:
  tclsh Grab-A-Site-1.0.tcl www.w3.org/pub/WWW/Protocols/ www.w3.org - 
dowload
  /pub/WWW/Protocols/ tree from web site www.w3.org to local directory 
www.w3.org.

  Grab-A-Site-1.0.tcl www.favorite.place/misc/aaa.tar.gz - download file
  aaa.tar.gz from directory /misc of www site www.favorite.place to current
  directory

  Grab-A-Site-1.0.tcl http://www.xpics.com/ /pics/cool - grab entire site
  www.xpics.com to local directory /pics/cool :-)

If the site is already downloaded, script performs update-check - it 
downloads
only pages/files, modified since last download.

Hint - if you hate this long script's name, just rename it or make symlink 
:-)

3. Known bugs.

  - Grab-A-Site-1.0.tcl doesn't handle cgi requests properly.
  - No image map support.

4. How it works.

 I don't know this exactly, but it works :-) Thanx to Dr. Ousterhout for 
his
nice Tcl language!

5. Status of this software.

  This package released as public domain code. Feel free to redistribute 
and
modify this code without author's permissions.

6. ToDo

- error handling impruvements.
- make p 3 clean :-)
- Tk-based GUI interface. Is it really needed?

Sergey Okhapkin					FidoNet 2:5020/47
						E-mail: [email-masked]

--------------------------------

--
Sergey Okhapkin
Moscow, Russia
Looking for a job.

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".