/***** $VER: RecentScript Online Search Importer 1.0 (12.3.98) ŠArndt van der Molen RecentScript Importer for online searching the AmiNet is a MUIRexx subapplication and can not be started directly. It is called only from RecentScript at the 'Import' button. This importer delivers the filename of a temporary file with a maximum of 400 archives matching the search string. The search string must be entered in the RecentScript GUI in the string gadget. Thanks: Thanks to 'bossman^' for his AMSD tool which gives me the inspiring idea for this importer. Known 'Bugs': - Temporary file will not be deleted *****/ OPTIONS RESULTS PARSE ARG portname ADDRESS VALUE portname MUIM_Busy_Move = '0x80020001' MUIA_Busy_Speed = '0x80020049' MUIV_Busy_Speed_Off = 0 maxfound = 400 /* Get search string from RecentScript string gadget */ string ID STR_PATT pattern = result IF pattern = "" THEN DO request ID RECSCRWIN TITLE '"Importer Error"' GADGETS "_OK" STRING "You must enter a search string in RecentScript" RETURN END IF SHOWLIST(H,'TCP') THEN DO IF OPEN(writehandle, 'T:RS.temp', 'W') THEN DO window ID OSWIN TITLE '"AmiNet Online Search "' PORT portname text ID OSTXT LABEL 'Connect to ftp.wustl.edu...' object CLASS '"Busy.mcc"' ID OSBUSY endwindow IF OPEN(tcphandle, 'TCP:ftp.wustl.edu/1848', 'W') THEN DO text ID OSTXT LABEL 'Search for "'pattern'"...' object ID OSBUSY ATTRS MUIA_Busy_Speed MUIV_Busy_Speed_Off WRITECH(tcphandle, 'max 'maxfound' ; find 'pattern' ; quit' || '0a'x || '0d'x) text ID OSTXT LABEL 'Retrieve search result...' DO UNTIL EOF(tcphandle) method ID OSBUSY MUIM_Busy_Move line = READLN(tcphandle) IF LEFT(line,6)='*** No' then leave WRITELN(writehandle, line) END CLOSE(tcphandle) CLOSE(writehandle) window ID OSWIN CLOSE RETURN "T:RS.temp" END ELSE DO request ID RECSCRWIN TITLE '"Importer Error"' GADGETS "_OK" STRING "Cannot connect to 'ftp.wustl.edu'" END window ID OSWIN CLOSE CLOSE(writehandle) END ELSE DO request ID RECSCRWIN TITLE '"Importer Error"' GADGETS "_OK" STRING "Cannot open temporary file" END END ELSE DO request ID RECSCRWIN TITLE '"Importer Error"' GADGETS "_OK" STRING "No TCP/IP found - You must be online!" END RETURN