/* $VER: GetNET.Thor 1.2 (6.5.96) by Remco van Hooff */ bbs = 'News&Mail' /* your Email system */ /* hotlists */ hotlist_amosaic = 'envarc:mosaic/.mosaic-hotlist-default' ; amosaic = 1 hotlist_ibrowse = 'AmiTCP:IBrowse/prefs/ibrowse-hotlist.html' ; ibrowse = 1 hotlist_aweb = 'AmiTCP:AWeb/aweb.hotlist' ; aweb = 1 hotlist_voyager = 'AmiTCP:/Voyager/bookmarks.html' ; voyager = 1 hotlist_html = 'AmiTCP:bin/lynx_bookmarks.html' ; html = 0 /* loop or not */ loop = 0 /* don't edit these */ cr = '0d'x lf = '0a'x tab= '09'x /* filter chars, expand if you want */ /* after the address */ filter.1.1 = cr filter.1.2 = lf filter.1.3 = ')' filter.1.4 = ',' filter.1.5 = "'" filter.1.6 = '"' filter.1.7 = ']' filter.1.8 = '>' filter.1.9 = '}' filter.1.10 = '*' filter.1.count = 10 /* number of filters */ /* in front of the address */ filter.2.1 = '(' filter.2.2 = '"' filter.2.3 = '<' filter.2.4 = '[' filter.2.5 = '{' filter.2.6 = ':' filter.2.7 = "'" filter.2.8 = tab filter.2.count = 8 tempfile = 't:temp.tmp' /*--------------------------------------------------------------------------*/ OPTIONS FAILAT 31 p = ADDRESS() || ' ' || SHOW('P',,) thorport = POS('THOR.',p) IF thorport > 0 THEN thorport = WORD(SUBSTR(p,thorport),1) ELSE DO SAY 'THOR port not found!' EXIT 10 END IF ~SHOW('p', 'BBSREAD') THEN DO ADDRESS COMMAND "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead" "WaitForPort BBSREAD" END ADDRESS(thorport) OPTIONS RESULTS CURRENTMSG stem MSG IF(RC ~= 0) THEN DO REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"' EXIT END msgnum = MSG.MSGNR curbbs = MSG.BBSNAME curconf = MSG.CONFNAME ADDRESS bbsread READBRMESSAGE BBSNAME '"'curbbs'"' CONFNAME '"'curconf'"' MSGNR msgnum HEADSTEM headtags IF(RC ~= 0) THEN DO REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"' EXIT END fromname = HEADTAGS.FROMNAME subj = HEADTAGS.SUBJECT IF POS('RE:',UPPER(subj)) ~=0 THEN subj = SUBSTR(subj,5) CALL main EXIT main: DROP FOUND. SAVE. NAME. REQUESTNOTIFY TEXT '"Choose what kind of addresses to get."' BT '"_HTTP|_Email|_Quit"' IF RESULT = 0 THEN EXIT IF RESULT = 1 THEN CALL get_http IF RESULT = 2 THEN CALL get_email IF loop = 1 THEN SIGNAL main RETURN /* gethttp */ get_http: SAVEMESSAGE CURRENT FILENAME tempfile NOANSI OVERWRITE IF(RC ~= 0) THEN DO REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"' EXIT END ELSE DO CALL gethttp CALL listfound IF ok = 1 THEN CALL listsave(1) END RETURN gethttp: CALL OPEN(tmp, tempfile, 'r') num = 0 found.count = 0 DO WHILE ~EOF(tmp) msg = READLN(tmp) msg = TRANSLATE(msg, 'hpt', 'HPT') PARSE VAR msg . 'ttp://' httpadres . IF httpadres ~= '' THEN DO lengte = length(httpadres) CALL filter(httpadres, lengte,1) httpadres = 'http://'||RESULT n = 0 DO i = 1 TO found.count IF httpadres ~= found.i THEN n = n +1 END IF n = found.count THEN DO num = num + 1 found.num = httpadres found.count = num END END END CALL CLOSE(tmp) ADDRESS COMMAND 'delete >nil: 'tempfile RETURN savehotlist: DO i = 1 TO save.count IF name.i = '' THEN name.i = subj '('i')' END IF amosaic = 1 THEN CALL save_amosaic IF ibrowse = 1 THEN CALL save_ibrowse IF html = 1 THEN CALL save_html IF aweb = 1 THEN CALL save_aweb IF voyager = 1 THEN CALL save_voyager IF amosaic+ibrowse+html+aweb+voyager = 0 THEN Requestnotify '"No hotlist(s) selected."' '"_OK"' IF loop = 1 THEN SIGNAL main RETURN save_amosaic: IF ~EXISTS(hotlist_amosaic) THEN DO Requestnotify '"Amosaic hotlist not found!"' '"_OK"' RETURN END ELSE DO dat = DATE() PARSE VAR dat dagnr maand jaar dag = LEFT(DATE('W', DATE(S), 'S'), 3) datum = dag maand dagnr TIME()jaar CALL OPEN(htlst,hotlist_amosaic,'a') DO i = 1 TO save.count CALL WRITELN(htlst,save.i||' '||datum) CALL WRITELN(htlst,STRIP(name.i)) END CALL CLOSE(htlst) END ADDRESS COMMAND 'copy' hotlist_amosaic 'env:mosaic/ quiet' RETURN save_ibrowse: IF ~EXISTS(hotlist_ibrowse) THEN DO Requestnotify '"IBrowse hotlist not found!"' '"_OK"' RETURN END ELSE DO CALL OPEN(in,hotlist_ibrowse,'r') CALL OPEN(out,'t:IBrowse.tmp','w') line = READLN(in) DO UNTIL line = '