/* Aminetfind script plug-in for AWeb $VER: AWebAminet.rexx 1.0ß2 (28.3.96) by Sami Itkonen What does it do: ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ Find Files from Aminet, using the TCP: device that comes with AmiTCP. What does it not do: ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ Parse Aminet RECENT files, thus it doesn't operate as an ADT client. Installation: ŻŻŻŻŻŻŻŻŻŻŻŻŻ Place the script in the same directory as the AWeb executable. Activate "Allow Shell commands in Links" in the 'Network1:General' settings of AWeb. Usage: ŻŻŻŻŻŻ Click the 'Start ARexx Macro' (Amiga-!) in the AWeb menu, and select this script OR execute 'run >NIL: rx AWebAminet.rexx' in the AmigaDOS shell. Any problems? ŻŻŻŻŻŻŻŻŻŻŻŻŻ The most common problems are dealt with by the script (like the inaccessibility of TCP:). If the 'Submit' button in the form doesn't work, then either 1) you don't have 'Allow Shell commands in Links' checked 2) the script is not in the same directory as AWeb 3) accessing the findserver is simply slow. In that case you consider using a different findserver. Note about FTP: Whatever (ftp://) URLs are in the Aminetfind Results are perfectly valid HTML. If they don't work, then either 1) the FTP site in question is inaccessible for the moment 2) you don't have FTP configured properly. See Network3:External programs in AWeb settings. For a suitable FTP script, you can use eg. Josef Faulkner's AwebFTP (available in Aminet) Any other problems, weird or not, outright bugs, HTML errors and such can be reported to the Author (mail to Sami.Itkonen@hut.fi). */ /* Configuration of the script: */ def_site = 'ftp.germany.aminet.org' /* Your default Aminet site */ def_findsite = 'haegar2.uni-paderborn.de' /* Your default findserver */ /* Main Script */ options results call Initialize parse arg args call ParseCmds action = upper(action) select when action = "FIND" then call FindWord when action = "CREATE" then call CreateForm when action = "ABOUT" then call About otherwise call CreateForm end exit FindWord: if keyword ~= "" then do if ~showlist(H,'TCP') then address command 'mount TCP: from amitcp:devs/inet-mountlist' if ~showlist(H,'TCP') then address command 'mount TCP:' if showlist(H,'TCP') then do if open(2,'tcp:'||findsite||'/1848',w) then do address command 'delete t:awebfind#?.html >NIL:' fname='t:awebfind'time(S)'.html' call open(1,fname,w) call writeln(1,'AminetFind results') call writeln(1,'

AminetFind Results

') call writeln(2,'max 'maxhits) call writeln(2,'width 'width) if exact="ON" then do if case="ON" then call writeln(2,'Find "'keyword'"') else call writeln(2,'find "'keyword'"') end else do if case="ON" then call writeln(2,'Find 'keyword) else call writeln(2,'find 'keyword) end call writeln(2,'quit') do until eof(2) text=readln(2) select when left(text,6)='*** No' then call writeln( 1, 'No matches found.
') when left(text,6)='*** Ad' then do call writeln( 1, '') call writeln( 1, 'Additional Matches Found.
') call writeln( 1, '') end when text = '' then foo = 1 when text = 'Unknown command (? for help).' then foo = 1 otherwise call WriteLine end end if found then call writeln(1,'') call writeln(1,'
') call writeln(1,'') call writeln(1,'New Search: ') call writeln(1,'') call writeln(1,'') call writeln(1,'
') call writeln(1,'
Created by 'version'') call close(1) address AWEB.1 'OPEN file://localhost/'fname end else FindError('Error opening TCP:') end else FindError('You need AmiTCP installed in the proper directories, or mount TCP:') end return Writeline: parse var text file.name file.dir file.size file.age file.desc astpos = pos('*', file.age) if findsite = 'haegar2.uni-paderborn.de' then do file.desc = file.age||file.desc file.age = '' end else if astpos ~= 0 then do file.desc = substr(file.age, astpos + 1) || file.desc file.age = left(file.age, astpos - 1) end file.desc = strip(file.desc) dot = lastpos(".", file.name) if ~found then do found = 1 call writeln( 1, "