From: sos AT prospect DOT com DOT ru (Sergey Okhapkin) Subject: Grab-a-Site 4 Feb 1997 03:20:45 -0800 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <01BC1297.F0CB7AC0.cygnus.gnu-win32@gater.krystalbank.msk.ru> Original-To: "'Gnu-Win32'" , "'Igor Gavrushkin'" Encoding: 96 TEXT, 121 UUENCODE X-MS-Attachment: Grab-A-Site-1.0.tcl 0 00-00-1980 00:00 Original-Sender: owner-gnu-win32 AT cygnus DOT com 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: sos AT prospect DOT com DOT ru -------------------------------- -- Sergey Okhapkin Moscow, Russia Looking for a job. begin 600 Grab-A-Site-1.0.tcl M(R$O=7-R+V)I;B]T8VQS: T*#0IP86-K86=E(')E<75I"YH=&UL#0IS970@;6%X=&AR96%DPT*"6=L;V)A;"!N=&AR96%DPT*"2,@;F]R;6%L(&-O;7!L971I;VX-"@D):68 AT 6W-TPT*"2,@" D=2 S75ML M:6YD97@@)'4@-%U]#0H)"6%R'0O:'1M;" DPT*"2,@97)R;W(-"@D)8VQO" D=2 S75ML:6YD M97@@)'4@-%U]#0H)(" @("!]#0H)?0T*?0T*#0HC#0HC($)R96%K(&1O=VX@ M=7)L#0HC(%)E='5R;G,@82!L:7-T(&]F('5R;"!P87)TPT*"6EF('LA(%MR96=E>' @+6YO8V%S92!<#0H@>RAH M='1P.B\O?&9T<#HO+WQG;W!H97(Z+R]\;6%I;'1O.GQN97=S.GQF:6QE.B]\ M=&5L;F5T.B\O*3\H6UXO.B-=*RD_*#HH6S M.5TK*2D_*%M>(UTJ+RD_*%M> M+R-=*RD_*",N*BD_?2!<#0H)"21U2!P;W)T('!A=&@@9FEL92!M87)K77T@>PT*"0EE'1H MUMS M=')I;F<@;&5N9W1H("1F:6QE72 ]/2 P?2![#0H)"7-E="!F:6QE("1D969A M=6QT;F%M90T*"7T-"@ES970@;&8@)&QO8V%L9&ER)'!A=&@D9FEL90T*"6EF M(%MF:6QE(&5X:7-TW-E="!C:&%N;F5L(%MO<&5N("1L M9B!R*UU]72![#0H)"0EP=71S(")#86XG="!O<&5N("1L9B(-"@D)"7)E='5R M;@T*"0E]#0H)"65X96,@=&]U8V@@)&QF#0H)?2!E;'-E('L-"@D)W-E="!C:&%N;F5L(%MO<&5N("1L9B!W*UU]72![#0H)"0EP=71S(")#86XG M="!CR1N M=&AR96%DPT*"0EV=V%I="!N=&AR96%DPT*"6=L;V)A;"!H;W-T#0H)=7!V87(@(S @)',@" D=2 S75ML:6YD97@@)'4@-%T-"@ER96=S=6(@+6%L;"![*%M>/%TJ*2@\ M*%M>/ETK*3XI?2!;' @+6YO8V%S92![*&AR968](BDH6UXB72LI M*"(I?2 D=&%G('@@>2!R969=('L-"@D)"6UA:V554DP@)')E9B D9FEL90T* M"0E](&5LRAB86-K9W)O=6YD/2(I*%M> M(ETK*2 AT B*7T@)'1A9R!X('D@(ETK M*2 AT B*7T@)'1A9R!X('D@" D=2 Q M70T*"7-E="!C<&]R="!;;&EN9&5X("1U(#)=#0H)UMS=')I;F<@;&5N9W1H("1C<&%T:%T@/3T@,'T@>R!R971U" D8W!A=&@@,%T@ M(B\B72![#0H)"0ES970@PT*"0D)W-E="!C<&%T:" B+R)]#0H)"7-E="!R970@)&-P;W)T)&-P871H M#0H)?0T*"2,@R];7B]=*R]<+EPN+WT@)')E=" B+R(@&ET#0I]#0II9B![)&%R9V,@/3T@,GT@>PT*"7-E M="!L;V-A;&1IPT*"7-E="!L M;V-A;&1I" D=2 P M70T*" D=2 Q70T*" D M=2 R70T*" D=2 S70T*" D=2 T70T*:68@>UMS=')I;F<@;&5N9W1H("1PW-E="!P