/* Strip INDEX or RECENT AmiNet lists 1.3 by Feril */ parse arg source /* ++++++ CUSTOM AREA ++++++ */ dest="T:FTPGet.exe" /* the DOS script name that will contain the FTPGet commands */ site="ftp.cs.tu-berlin.de" /* your favorite ftp site */ localdir="hd1:comm/down/" /* the local destination for d/l'ed files*/ username="hafer" /* your user name for the InterNet */ force=1 /* set to 1 if you don't wanna FTPGet to break after an error; else use 0 */ info=1 /* set to 1 if you want to see a d/l update */ sig_whole='[d]' /* the tag for full downloads */ sig_read='[r]' /* the tag for readme downloads */ ovl=' ' /* the string that will overwrite the tags in the INDEX or RECENT */ /* ++++++ from now on leave it be ;^) ++++++ */ hit=0 if ~open('in',source,R) then exit if ~open('out',dest,W) then exit say 'Checking...' call writeln('out','SetEnv LOCALDIR='localdir) call writeln('out','SetEnv USERNAME='username) call writech('out','FTPGET 'site' REMOTE') do forever in=readln('in') num=words(in) select when eof('in') then leave when word(in,num)=sig_whole then do call writech('out',' /pub/aminet/'word(in,2)'/'word(in,1)) say 'Got: /pub/aminet/'word(in,2)'/'word(in,1) tag_pos=pos(sig_whole,in) call kill_tag() end when word(in,num)=sig_read then do name=' /pub/aminet/'word(in,2)'/'word(in,1) length=length(name) call writech('out',left(name,length-4)'.readme') say 'Got: 'left(name,length-4)'.readme' tag_pos=pos(sig_read,in) call kill_tag() end otherwise end end call close('in') if force then call writech('out',' FORCE') if info then call writech('out',' INFO') call close('out') if hit then say 'OutPut file is 'dest'.' else say 'Nothing found.' exit kill_tag: in_length=length(in)+1 call seek('in',-in_length) call writeln('in',overlay(ovl,in,tag_pos)) hit=1 return