home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / internet / yamexpansion19 / yamexp / yamexp.rexx.ita < prev    next >
Text File  |  1997-08-23  |  39KB  |  1,221 lines

  1. /* ---------------------------------------------------------------- */
  2. /*                                                                  */
  3. /*                           YAM-Expansion v1.9                     */
  4. /*                                                                  */
  5. /*                   (C) 1997 by Diego 'dx0' de Felice              */
  6. /*                                                                  */
  7. /*                                                                  */
  8. /*  this program is freeware, but you cannot use the whole code or  */
  9. /*                   a part of it in your programs.                 */
  10. /* ---------------------------------------------------------------- */
  11.  
  12. options results
  13. didi=''
  14. dido=''
  15.  
  16. parse arg didi dido
  17.  
  18. NoNotifySet = 0x8042216f
  19. Application_AboutMUI = 0x8042d21d
  20. Application_OpenConfigWindow = 0x804299ba
  21.  
  22. Draggable = 0x80420b6e
  23. Listview_DragType = 0x80425cd3
  24. List_Format =                     0x80423c0a
  25. Weight =                          0x80421d1f
  26. Numeric_Value = 0x8042ae3a
  27. Menuitem_Title = 0x804218be
  28. Menuitem_Shortcut =               0x80422030
  29. Boopsi_MinHeight =                0x80422c93
  30. Boopsi_MinWidth =                 0x80428fb2
  31. Boopsi_Remember =                 0x8042f4bd
  32. Boopsi_TagScreen =                0x8042bc71
  33.  
  34. TRUE = 1
  35. FALSE = 0
  36. Listview_DragType_None = 0
  37. Listview_DragType_Immediate = 1
  38. Frame_None = 0
  39. Frame_Text = 3
  40. TriggerValue = 0x49893131
  41. EveryTime = 0x49893131
  42.  
  43. MUIA_List_AutoVisible = 0x8042a445
  44. MUIA_List_Format = 0x80423c0a
  45. MUIA_List_DragSortable =    0x80426099
  46. List_Remove = 0x8042647e
  47.  
  48. MUIA_List_Active =          0x8042391c
  49. MUIA_List_Insert_Bottom = -3
  50. MUIV_List_Remove_Active = -1
  51. MUIA_List_Entries =         0x80421654
  52. MUIM_List_Redraw = 0x80427993
  53. MUIM_List_Clear = 0x8042ad89
  54. List_GetEntry = 0x804280ec
  55.  
  56. Draggable = '0x80420b6e'
  57. Dirlist_RejectIcons = '0x80424808'
  58. Listview_DragType = '0x80425cd3'
  59. Listview_MultiSelect = '0x80427e08'
  60. Menuitem_Title = '0x804218be'
  61. Weight = '0x80421d1f'
  62. ShowMe = '0x80429ba8'
  63.  
  64. MUIA_Window_PublicScreen =  0x804278e4
  65. MUIA_List_Format =                     0x80423c0a
  66. MUIA_List_Entries =                    0x80421654
  67. MUIA_String_Contents = 0x80428ffd
  68. MUIA_Group_SameHeight = 0x80428ffd
  69. MUIV_List_Insert_Sorted = -2
  70. MUIV_List_Active_Off = -1
  71.  
  72. MUIM_List_Clear = 0x8042ad89
  73. MUIA_List_Active =          0x8042391c
  74. MUIM_List_GetEntry =        0x804280ec
  75.  
  76. selected= 0x8042654b
  77.  
  78. askb0='Sei sicuro di voler modificare una email '
  79. askb1=' ?'
  80. suff0='Spedita'
  81. suff1='In Arrivo'
  82. suff2='Archiviata'
  83. portazze=show('P') || ' '
  84.  
  85. frommo='Aminet mailing list maintainer <aminetd@wuarchive.wustl.edu>'
  86. giornal="Today's Aminet uploads on"
  87. settima="This week's Aminet uploads on"
  88. error1='Questa non è una email della mailing list di Aminet !!!'
  89. primadeifili ='|----------------- ---        ---- -----------'
  90. primadeifilis='|----------------- ---        ---- --- -----------'
  91. msgday='Message of the day:'
  92. msgmir='MIRROR STATUS:'
  93.  
  94. statino=' Pronto a servirti...'
  95. statinozzo='Yam-Expansion v1.9 by Dx0. Contattami a:d.defelice@ba.nettuno.it'
  96.  
  97. address YAMEXP
  98.  
  99. select
  100.  
  101.  when didi='RIMOZZO' then call removazzo
  102.  when didi='MAKOZZO' then call makkolo
  103.  when didi='FOKOZZO' then call fokkolo
  104.  when didi='WRL' then call ritodrl
  105.  when didi='WCH' then call riwekch
  106.  when didi='WMD' then call riwekmd
  107.  when didi='ADALL' then call selezionazzi
  108.  when didi='FF' then call faiftp
  109.  
  110.  when didi='XIXI' then do
  111.                        text ID STATUS LABEL statino
  112.                        address YAMEXP window ID cicciotto CLOSE
  113.                        address command 'delete t:mess'
  114.                        address command 'delete t:moment'
  115.                        address command 'delete t:today'
  116.                        address command 'delete t:todrl'
  117.                        address command 'delete t:wekch'
  118.                        address command 'delete t:wekmd'
  119.                        end
  120.  
  121.  when didi='' then do
  122.                    if find(portazze,'YAM')=0 then
  123.                       do
  124.                       window ID DOZE COMMAND PORT YAMExp TITLE "Messaggio di Errore"
  125.                              group
  126.                              label CENTER "Per favore lancia prima Yam !!!"
  127.                              button ID ERR COMMAND '"quit"' PORT YAMEXP LABEL "Vabbè lo farò"
  128.                              endgroup
  129.                       endwindow
  130.                       exit
  131.                       end
  132.                    call conamiga
  133.                    call faiwindoze
  134.                    end
  135.  
  136.  when didi='HTMLL' then call htmlla
  137.  when didi='AGGI' then call aggiftpmail
  138.  
  139.  when didi='DAMME' then do
  140.                         address YAMEXP popasl ID BACIO
  141.                         batchio=result
  142.                         address command 'delete' batchio
  143.                         end
  144.  
  145.  when didi='BATOSTA' then do
  146.                           address YAMEXP popasl ID BACIO
  147.                           batchio=result
  148.                           window ID BICCIO PORT YAMExp TITLE """Contenuto File Batch AmFtp"""
  149.                              group FRAME LABELS "AmFtp Batch File"
  150.                                view FILE batchio
  151.                              endgroup
  152.                              group HORIZ
  153.                                button COMMAND '"yamexp.rexx DAMME"' LABEL "Cancella File"
  154.                                button COMMAND """window ID BICCIO CLOSE""" PORT YAMEXP LABEL "Esci"
  155.                              endgroup
  156.                           endwindow
  157.                           end
  158.  
  159.  when didi='RASSALO' then do
  160.                           tipozzolo=3
  161.                           call ransignalo
  162.                           end
  163.  
  164.  when didi='RASGALO' then do
  165.                           tipozzolo=1
  166.                           call ransignalo
  167.                           end
  168.  
  169.  when didi='RASTALO' then do
  170.                           tipozzolo=2
  171.                           call ransignalo
  172.                           end
  173.  
  174.  when didi='SALVAGALO' then do
  175.                             ftpmailsites=word(dido,1)
  176.                             aminethtmlsites=word(dido,2)
  177.                             aminetftpsites=word(dido,3)
  178.                             call salvaamiga
  179.                             window ID WINDOZE CLOSE
  180.                             call faiwindoze
  181.                             end
  182.  
  183.  when didi='FICCALA' then do
  184.                           ftpmailsites=word(dido,1)
  185.                           aminethtmlsites=word(dido,2)
  186.                           aminetftpsites=word(dido,3)
  187.                           call amigala
  188.                           window ID WINDOZE CLOSE
  189.                           call faiwindoze
  190.                           end
  191.  otherwise nop
  192.  
  193. end
  194.  
  195. exit
  196.  
  197. /* ---------------------< Funzioni >-------------------------------------------------------------------------------------------------------------------- */
  198.  
  199. faiwindoze:
  200.  
  201. window ID WINDOZE COMMAND "quit" PORT YAMExp TITLE """YAM-Expansion v1.9 (by dx0)"""
  202.  
  203.  group ID MMM REGISTER PORT YAMExp LABELS "Principale,Configurazione"
  204.  
  205.   group
  206.  
  207. if feffone=1 then do
  208.                   group ID AMI1 FRAME LABELS "Aminet"
  209.                     button ID AMINETTER COMMAND '"YAMExp.rexx HTMLL"' HELP '"Crea un file html da una recent-email di Aminet"' LABEL "Crea Recent-HTML"
  210.                     button ID FTPIT COMMAND '"YAMExp.rexx FF"' HELP '"Crea una ftpmail o un file batch per AmFtp da una recent-email di Aminet"' LABEL "Sezione Ftp"
  211.                   endgroup
  212.                   end
  213.  
  214. if sfeffeo=1 then do
  215.                   group ID SISSI FRAME LABELS "Firma"
  216.                     button ID RASI COMMAND '"YAMExp.rexx RASSALO"' HELP '"Firma la email selezionata con una firma casuale"' LABEL "Firma Casuale"
  217.                     button ID RANSSIGN COMMAND '"YAMExp.rexx RASGALO"' HELP '"Firma la email selezionata con una firma seria"' LABEL "Firma Seria"
  218.                     button ID RANNSIGN COMMAND '"YAMExp.rexx RASTALO"' HELP '"Firma la email selezionata con una firma informale"' LABEL "Firma Informale"
  219.                   endgroup
  220.                   end
  221.  
  222. if pappone=1 then do
  223.                   button ID ABO COMMAND '"text ID STATUS LABEL  Yam-Expansion v1.9 by Dx0"' PORT YAMEXP ICON "yamexpansion:data/icon"
  224.                   end
  225.  
  226.   endgroup
  227.  
  228.   cantatu=ftpmailsites aminethtmlsites aminetftpsites
  229.  
  230.   group
  231.  
  232.     group FRAME LABELS "Aminet"
  233.  
  234.       group HORIZ
  235.         label CENTER "Url Ftpmail:"
  236.         poplist ID SFTP COMMAND '"YAMExp.rexx AGGI 'cantatu'"' HELP '"Seleziona la URL della ftpmail"' LABELS ftpmailsites CONTENT ftpmailurl
  237.       endgroup
  238.  
  239.       group HORIZ
  240.         label CENTER "Url HTML di Aminet:"
  241.         poplist ID FTPLINK COMMAND '"YAMExp.rexx AGGI 'cantatu'"' HELP '"Seleziona la URL Html di Aminet"' LABELS aminethtmlsites CONTENT amineturl
  242.       endgroup
  243.  
  244.       group HORIZ
  245.         label CENTER "Url Ftp di Aminet:"
  246.         poplist ID FTPP COMMAND '"YAMExp.rexx AGGI 'cantatu'"' HELP '"Seleziona la URL Ftp di Aminet"' LABELS aminetftpsites CONTENT ftpsitu
  247.       endgroup
  248.  
  249.       group HORIZ
  250.         label CENTER "Aminet Dir:"
  251.         string ID DIRRA HELP '"Inserisci la directory che contiene Aminet"' CONTENT aminetdir
  252.       endgroup
  253.  
  254.       group HORIZ
  255.         label CENTER "File Batch di AmFtp:"
  256.         popasl ID BACIO HELP '"Inserisci il nome del file per il file batch di AmFtp"' CONTENT batchfile
  257.       endgroup
  258.  
  259.       group HORIZ
  260.         check ID FB ATTRS selected baffone
  261.         label CENTER "aggiungi voci al file batch"
  262.       endgroup
  263.  
  264.       group HORIZ
  265.         check ID RIB ATTRS selected raffone
  266.         label CENTER "scarica file .readme"
  267.       endgroup
  268.  
  269.     endgroup
  270.  
  271.     group FRAME LABELS "Firma"
  272.  
  273.       group HORIZ
  274.         label CENTER "Firma Seria:"
  275.         popasl ID SERSIGN HELP '"Seleziona il file con la firma seria"' CONTENT seriaccio
  276.       endgroup
  277.  
  278.       group HORIZ
  279.         label CENTER "Firma Informale:"
  280.         popasl ID INFSIGN HELP '"Seleziona il file con la firma informale"' CONTENT gaglioffo
  281.       endgroup
  282.  
  283.     endgroup
  284.  
  285.     group FRAME LABELS "Varie"
  286.  
  287.       group HORIZ
  288.         check ID SWIAM ATTRS selected feffone
  289.         label CENTER "attiva le funzioni Aminet"
  290.       endgroup
  291.  
  292.       group HORIZ
  293.         check ID SWISI ATTRS selected sfeffeo
  294.         label CENTER "attiva le funzioni di firma"
  295.       endgroup
  296.  
  297.       group HORIZ
  298.         check ID ICOC ATTRS selected pappone
  299.         label CENTER "attiva il logo YamExpansion"
  300.       endgroup
  301.  
  302.     endgroup
  303.  
  304.     group HORIZ
  305.      button ID USAI COMMAND '"yamexp.rexx FICCALA 'cantatu'"' LABEL "Usa"
  306.      button ID SAVAI COMMAND '"yamexp.rexx SALVAGALO 'cantatu'"' LABEL "Salva"
  307.     endgroup
  308.  
  309.   endgroup
  310.  
  311.  endgroup
  312.  
  313.  text ID STATUS LABEL statino
  314.  
  315. endwindow
  316.  
  317. return
  318.  
  319. /* ---------------------------------------------------------------- */
  320.  
  321. aggiftpmail:
  322.  
  323. ftpmailsites=word(dido,1)
  324. aminethtmlsites=word(dido,2)
  325. aminetftpsites=word(dido,3)
  326.  
  327. address YAMEXP poplist ID SFTP
  328. gingilli=result
  329. if pos(gingilli,ftpmailsites)=0 then do
  330.                                      ftpmailsites=gingilli||','||ftpmailsites
  331.                                      end
  332.  
  333. address YAMEXP poplist ID FTPP
  334. gingillis=result
  335. if pos(gingillis,aminetftpsites)=0 then do
  336.                                         aminetftpsites=gingillis||','||aminetftpsites
  337.                                         end
  338.  
  339. address YAMEXP poplist ID FTPLINK
  340. gingillia=result
  341. if pos(gingillia,aminethtmlsites)=0 then do
  342.                                          aminethtmlsites=gingillia||','||aminethtmlsites
  343.                                          end
  344. call amigala
  345. window ID WINDOZE CLOSE
  346. call faiwindoze
  347. return
  348.  
  349. ransignalo:
  350.  
  351. addlib('rexxsupport.library',0,-30)
  352.  
  353. statino=' Sto firmando la tua email...'
  354. address YAMEXP text ID STATUS LABEL statino
  355.  
  356. address 'YAM'
  357.  
  358. getfolderinfo NUMBER
  359. zainetto=result
  360.  
  361. select
  362.  
  363. when zainetto=0 then do
  364.                      'request "'askb0 suff1 askb1'" "_Si lo voglio|_No scusa"'
  365.                      if result=0 then exit end
  366.                      end
  367.  
  368. when zainetto=2 then do
  369.                      'request "'askb0 suff0 askb1'" "_Si lo voglio|_No scusa"'
  370.                      if result=0 then exit end
  371.                      end
  372.  
  373. when zainetto>2 then do
  374.                      'request "'askb0 suff2 askb1'" "_Si lo voglio|_No scusa"'
  375.                      if result=0 then exit end
  376.                      end
  377. otherwise nop
  378. end
  379.  
  380. select
  381.  
  382.   when tipozzolo=1 then do
  383.                         address YAMEXP popasl ID SERSIGN
  384.                         figoccio=result
  385.                         end
  386.  
  387.   when tipozzolo=2 then do
  388.                         address YAMEXP popasl ID INFSIGN
  389.                         figoccio=result
  390.                         end
  391.  
  392.   when tipozzolo=3 then do
  393.                         listarande=SHOWDIR('yamexpansion:ransigns','FILE',' ')
  394.                         mutrande=words(listarande)                  /* File random da appendere */
  395.                         randa=random(1,mutrande,time(s))
  396.                         figoccio='yamexpansion:ransigns/' || word(listarande,randa)
  397.                         end
  398.   otherwise nop
  399.  
  400. end
  401.  
  402. call open(luvi,figoccio,'R')
  403.  
  404. getmailinfo file                         /* File a cui appendere */
  405. call open(infamona,result,'A')
  406.  
  407. writeln(infamona,'--')
  408. writeln(infamona,'')
  409.  
  410. do until EOF(luvi)                           /* Riempe l'email */
  411.          limazzaza=readln(luvi)
  412.          writeln(infamona,limazzaza)
  413. end
  414.  
  415. call close(infamona)                            /* Chiusura dei file */
  416. call close(luvi)
  417. mailupdate
  418.  
  419. statino=' Operazione eseguita, pronto a servirti...'
  420. address YAMEXP text ID STATUS LABEL statino
  421.  
  422. return
  423.  
  424. /* ---------------------------------------------------------------- */
  425.  
  426. htmlla:
  427.  
  428. statino=' Sto creando il tuo file html...'
  429. address YAMEXP text ID STATUS LABEL statino
  430.  
  431. address YAMEXP poplist ID FTPLINK
  432. amineturl=result
  433.  
  434. address YAMEXP string ID DIRRA
  435. aminetdir=result
  436.  
  437. address 'YAM'
  438.  
  439. getmailinfo from
  440. vediamo=compare(result,frommo)
  441.  
  442. if vediamo~=0 then do
  443.                    'request "'error1'" "_Oh hai ragione"'
  444.                    exit
  445.                    end
  446. else
  447.  
  448. do
  449.  
  450. getmailinfo sub
  451. eccolo=result
  452.  
  453. getmailinfo file
  454. call open(carmela,result,'R')
  455.  
  456. if find(eccolo,giornal) then do
  457.                              flaggo=0
  458.                              call creafile('Daily.')
  459.                              call titola(eccolo)
  460.                              call tavolozza(primadeifili)
  461.                              call ilresto
  462.                              call chiudihtml(filo)
  463.                              call close(carmela)
  464.                              end
  465.  
  466. if find(eccolo,settima) then do
  467.                              flaggo=1
  468.                              call creafile('Weekly.')
  469.                              call titola(eccolo)
  470.                              call tavolozza(primadeifili)
  471.                              call chiudihtml(filo)
  472.  
  473.                              flaggo=2
  474.                              call creafile('MostDL.')
  475.                              titolomost='I file più richiesti da Aminet durante la settimana precedente il ' || daten
  476.                              call titola(titolomost)
  477.                              call tavolozza(primadeifilis)
  478.                              call chiudihtml(filo)
  479.  
  480.                              call creafile('Charts.')
  481.                              titolochart='I programmi più votati durante la settimana precedente il ' || daten
  482.                              call titola(titolochart)
  483.                              call tavolozza(primadeifilis)
  484.                              call ilresto
  485.                              call chiudihtml(filo)
  486.  
  487.                              call close(carmela)
  488.                              end
  489.  
  490. address 'YAM'
  491.  
  492. portazze=show('P') || ' '
  493.  
  494. if pos('VOYAGER',portazze)=0 & pos('IBROWSE',portazze)=0 & pos('AWEB',portazze)=0 & pos('MINDWALKER',portazze)=0 then
  495.  
  496.   do
  497.   if flaggo=0 then do
  498.                    risultati='Il file contenente la lista di file è chiamato: ' nome
  499.                    'request "'risultati'" "_Oh Grazie"'
  500.                    end
  501.   if flaggo>0 then do
  502.                    risultati='I file sono chiamati: yamexpansion:html/Weekly.' || daten || '.html, yamexpansion:html/MostDL.' || daten || '.html, Yamexpansion:html/Chart.' || daten || '.html'
  503.                    'request "'risultati'" "_Oh Grazie"'
  504.                    end
  505.   end
  506.  
  507. else do
  508.      if flaggo=0 then call sballa(nome)
  509.      if flaggo>0 then do
  510.                       selecta='Prego seleziona la pagina da inviare al tuo browser'
  511.                       angela=10
  512.                        do while angela~=0
  513.                          'request "'selecta'" "_Weekly Uploads|_Most downloaded|_Charts|_Esci"'
  514.                          angela=result
  515.                          if angela=1 then call sballa('yamexpansion:html/Weekly.'||daten||'.html')
  516.                          if angela=2 then call sballa('yamexpansion:html/MostDL.'||daten||'.html')
  517.                          if angela=3 then call sballa('yamexpansion:html/Charts.'||daten||'.html')
  518.                        end
  519.                       end
  520.      end
  521. end
  522.  
  523. statino=' Operazione completata. Pronto a servirti...'
  524. address YAMEXP text ID STATUS LABEL statino
  525.  
  526. return
  527.  
  528. sballa:
  529. parse arg chiama
  530.                                       /* Manda il file al browser */
  531.  
  532. if pos('VOYAGER',portazze)>0 then address 'VOYAGER' 'OpenURL file:///'|| chiama
  533.  
  534. if pos('IBROWSE',portazze)>0 then address 'IBROWSE' 'GotoURL file:///' || chiama
  535.  
  536. if pos('AWEB',portazze)>0 then do
  537.                                address value substr(portazze,pos('AWEB.',portazze),6)
  538.                                'Open file://localhost/' || chiama
  539.                                end
  540.  
  541. if pos('MINDWALKER',portazze)>0 then address 'MINDWALKER' 'OpenURL file:///'|| chiama
  542.  
  543. return
  544.  
  545.  
  546. creafile:                  /* Creazione del file */
  547. parse arg prex
  548.  
  549. getmailinfo sub
  550. nome=right(result,11)
  551. nome=strip(nome)
  552. daten=nome
  553. nome='yamexpansion:html/' || prex || nome || '.html'
  554. call open(filo,nome,'W')
  555.  
  556. return
  557.  
  558.  
  559. chiudihtml:                /* Chiusura dell'html */
  560. parse arg filoccioccio
  561.  
  562. writeln(filo,'<center>')
  563. writeln(filo,'<hr>')
  564. writeln(filo,'<h4>Send comments and whatever you want to: <B>Diego dx0 de Felice <a href="mailto:d.defelice@ba.nettuno.it">d.defelice@ba.nettuno.it</B></a>')
  565. writeln(filo,'</H4>')
  566. writeln(filo,'<h5>Created with YAM-Expansion v1.0 by <a href="mailto:d.defelice@ba.nettuno.it">Diego dx0 de Felice</a></h5>')
  567. writeln(filo,'</center>')
  568.  
  569. writeln(filo,'</body>')
  570. writeln(filo,'</html>')
  571. call close(filoccioccio)
  572.  
  573. return
  574.  
  575.  
  576. titola:                    /* Intestazione */
  577. parse arg subbo
  578.  
  579. writeln(filo,'<HTML>')
  580. writeln(filo,'<HEAD>')
  581. writeln(filo,'<!DOCTYPE HTML PUBLIC "-//IETF//DD HTML 3.0//EN">')
  582. writeln(filo,'<!-- AUTHOR="Diego dx0 de Felice" -->')
  583. writeln(filo,'<!-- EMAIL="d.defelice@ba.nettuno.it" -->')
  584. writeln(filo,'<!-- COMMENT="Made by YAM-Expansion for YAM (by Marcel Beck)." -->')
  585. writeln(filo,'<TITLE>'|| subbo ||'</TITLE>')
  586. writeln(filo,'</HEAD>')
  587. writeln(filo,'<BODY bgcolor="#FFFFFF">')
  588.  
  589. if subbo~='' then do                        /* Titolo del documento */
  590.                   writeln(filo,'<p>')
  591.                   writeln(filo,'<ul>')
  592.                   writeln(filo,'<H2><li><strong>'|| subbo ||'</strong></H2>')
  593.                   writeln(filo,'</ul></p>')
  594.                   subbo=''
  595.                   end
  596.  
  597. if flaggo=2 then  writeln(filo,'<center><h3> Most popular file on top</h3></center>')
  598.  
  599. return
  600.  
  601.  
  602. ilresto:                     /* Scrivacchia i messaggi dopo */
  603.  
  604. do until EOF(carmela)                       /* Se c'e' qualcosa dopo lo scrive */
  605.          lineazza=readln(carmela)
  606.  
  607.          if lineazza=msgday | lineazza=msgmir then
  608.  
  609.                   do                        /* Messages */
  610.                   writeln(filo,'<ul>')
  611.                   writeln(filo,'<H3><li><strong>'|| lineazza ||'</strong></H3>')
  612.                   writeln(filo,'</ul>')
  613.                   lineazza=readln(carmela)
  614.                   end
  615.  
  616.          writeln(filo,'<h5>'|| lineazza || '</H5>')
  617.          end
  618. return
  619.  
  620.  
  621. tavolozza:                                  /* Tavola */
  622. parse arg primas
  623.  
  624. writeln(filo,'<p>')
  625. writeln(filo,'<center><table border=3>')
  626. writeln(filo,'<TR>')                             /* prima riga standard */
  627. writeln(filo,'<th bgcolor="#ffff00"><h3>File</h3></th>')
  628. writeln(filo,'<th bgcolor="#ffff00"><h3>Dir</h3></th>')
  629. writeln(filo,'<th bgcolor="#ffff00"><h3>Size</h3></th>')
  630. if flaggo=2 then writeln(filo,'<th bgcolor="#ffff00"><h3>Age</h3></th>')
  631. writeln(filo,'<th bgcolor="#ffff00"><h3>Description</h3></th>')
  632. writeln(filo,'</TR>')
  633.  
  634. lineazza=readln(carmela)                    /* Salta l'intestazione */
  635.  
  636. do until lineazza=primas
  637.          lineazza=readln(carmela)
  638.          end
  639.  
  640. do until lineazza=''                        /* Corpo della tabella */
  641.          lineazza=readln(carmela)
  642.  
  643.          if lineazza='' then writeln(filo,'</table></center><h6></h6></p><br>') /* Fine tabella */
  644.  
  645.          sfile=substr(lineazza,1,18)
  646.          sfile=compress(sfile,' ')
  647.          sdir=substr(lineazza,20,10)
  648.          sdir=compress(sdir,' ')
  649.          ssize=substr(lineazza,31,4)
  650.          ssize=compress(ssize,' ')
  651.          sdescription=substr(lineazza,36,44)
  652.  
  653.          if flaggo=2 then do
  654.                           sage=substr(lineazza,36,3)
  655.                           sage=compress(sage,' ')
  656.                           sdescription=substr(lineazza,40,40)
  657.                           end
  658.  
  659.          linkolo=amineturl || aminetdir || sdir || '/' || sfile
  660.          ciccia=verify(sfile,'.','m')
  661.          leggilo=left(sfile,ciccia)
  662.          readmelo=amineturl || aminetdir || sdir || '/' || leggilo || 'readme'
  663.  
  664.          writeln(filo,'<tr>')
  665.          writeln(filo,'<td><h5><a href="'|| linkolo ||'">' || sfile || '</a></h5></td>')
  666.          writeln(filo,'<td><h5>' || sdir || '</h5></td>')
  667.          writeln(filo,'<td align=center><h5>' || ssize || '</h5></td>')
  668.          if flaggo=2 then writeln(filo,'<td align=center><h5>' || sage || '</h5></td>')
  669.          writeln(filo,'<td><h5><a href="'|| readmelo||'">' || sdescription || '</a></h5></td>')
  670.          writeln(filo,'</tr>')
  671.          end
  672. return
  673.  
  674.  
  675.  
  676. conamiga:
  677.  
  678. call open(amigascura,'yamexpansion:yamexp.config','R')
  679.  
  680. amineturl=readln(amigascura)
  681. aminetdir=readln(amigascura)
  682. sfeffeo=readln(amigascura)
  683. feffone=readln(amigascura)
  684. ftpmailurl=readln(amigascura)
  685. gaglioffo=readln(amigascura)
  686. seriaccio=readln(amigascura)
  687. ftpsitu=readln(amigascura)
  688. batchfile=readln(amigascura)
  689. baffone=readln(amigascura)
  690. pappone=readln(amigascura)
  691. ftpmailsites=readln(amigascura)
  692. aminethtmlsites=readln(amigascura)
  693. aminetftpsites=readln(amigascura)
  694. raffone=readln(amigascura)
  695.  
  696. call close(amigascura)
  697.  
  698. return
  699.  
  700.  
  701. salvaamiga:
  702.  
  703. call amigala
  704.  
  705. call open(amigascura,'yamexpansion:YamExp.config','W')
  706.  
  707. call writeln(amigascura,amineturl)
  708. call writeln(amigascura,aminetdir)
  709. call writeln(amigascura,sfeffeo)
  710. call writeln(amigascura,feffone)
  711. call writeln(amigascura,ftpmailurl)
  712. call writeln(amigascura,gaglioffo)
  713. call writeln(amigascura,seriaccio)
  714. call writeln(amigascura,ftpsitu)
  715. call writeln(amigascura,batchfile)
  716. call writeln(amigascura,baffone)
  717. call writeln(amigascura,pappone)
  718. call writeln(amigascura,ftpmailsites)
  719. call writeln(amigascura,aminethtmlsites)
  720. call writeln(amigascura,aminetftpsites)
  721. call writeln(amigascura,raffone)
  722.  
  723. call close(amigascura)
  724. return
  725.  
  726.  
  727. amigala:
  728.  
  729. poplist ID FTPLINK
  730. amineturl=result
  731. string ID DIRRA
  732. aminetdir=result
  733. check ID SWISI
  734. sfeffeo=result
  735. check ID SWIAM
  736. feffone=result
  737. poplist ID SFTP
  738. ftpmailurl=result
  739. popasl ID INFSIGN
  740. gaglioffo=result
  741. popasl ID SERSIGN
  742. seriaccio=result
  743. poplist ID FTPP
  744. ftpsitu=result
  745. popasl ID BACIO
  746. batchfile=result
  747. check ID FB
  748. baffone=result
  749. check ID ICOC
  750. pappone=result
  751. check ID RIB
  752. raffone=result
  753.  
  754. return
  755.  
  756. /* --------------------- FTP SECTION -------------------------- */
  757.  
  758. winsozz:
  759.  
  760. address YAMEXP
  761.  
  762. window ID cicciotto TITLE "Sezione-Ftp" PORT YAMEXP
  763.  
  764.  group
  765.  
  766.   group HORIZ
  767.      label CENTER "Tipo:"
  768.      text ID TIPPO LABEL "domani"
  769.      object CLASS '"Balance.mui"'
  770.      label CENTER "Data:"
  771.      text ID DATTO LABEL "oggi"
  772.   endgroup
  773.  
  774.   group ID FFF FRAME LABELS "Lista dei File nell'email"
  775.  
  776.   list ID ZAM COMMAND '"YAMEXP.rexx ADALL"' TITLE '"\033bFile,\033bDirectory,\033bDim.,\033bEtà,\033bDescrizione"' INSERT NODUP ATTRS Listview_DragType Listview_DragType_Immediate Listview_MultiSelect Listview_MultiSelect_Shifted MUIA_List_Format '"P=\033l BAR,P=\033l BAR,P=\033c BAR,P=\033c BAR,P=\033l"' HELP '"Seleziona i file da includere nella lista sottostante"'
  777.  
  778.     group HORIZ
  779.      label CENTER "Numero Totale di File:"
  780.      text ID SNFIFFI LABEL 0
  781.      label CENTER "Dimensione Totale (Byte):"
  782.      text ID SNSIZZI LABEL 0
  783.     endgroup
  784.  
  785.   if tipox=1 then do
  786.                   group HORIZ
  787.                   button COMMAND '"YAMEXP.rexx WRL"' LABEL "Weekly Uploads"
  788.                   button COMMAND '"YAMEXP.rexx WMD"' LABEL "Most Downloaded"
  789.                   button COMMAND '"YAMEXP.rexx WCH"' LABEL "Aminet Chart"
  790.                   endgroup
  791.                   end
  792.  
  793.    button COMMAND '"YAMEXP.rexx ADALL"' LABEL "Aggiungi file quando i contatori di sopra sono fermi"
  794.    endgroup
  795.    group FRAME LABELS "File Selezionati"
  796.     list ID SELEN COMMAND '"YAMEXP.rexx RIMOZZO"' TITLE '"\033bFile,\033bDirectory,\033bDim.,\033bEtà,\033bDescrizione"' INSERT NODUP ATTRS Listview_DragType Listview_DragType_Immediate Listview_MultiSelect Listview_MultiSelect_Shifted MUIA_List_Format '"P=\033l BAR,P=\033l BAR,P=\033c BAR,P=\033c BAR,P=\033l"' HELP '"Seleziona i file da includere nella ftpmail o nel file batch"'
  797.  
  798.     group HORIZ
  799.      label CENTER "Totale File Selezionati:"
  800.      text ID NFIFFI LABEL 0
  801.      label CENTER "Dimensione Totale (Byte):"
  802.      text ID NSIZZI LABEL 0
  803.     endgroup
  804.  
  805.     group HORIZ
  806.     button COMMAND '"YAMEXP.rexx MAKOZZO"' LABEL "Crea FtpMail"
  807.     button COMMAND '"YAMEXP.rexx FOKOZZO"' LABEL "Crea Batch per AmFtp"
  808.     button COMMAND '"YAMEXP.rexx BATOSTA"' LABEL "Vedi File Batch"
  809.     button COMMAND '"YAMEXP.rexx RIMOZZO"' LABEL "Rimuovi File"
  810.     button COMMAND '"YAMEXP.rexx XIXI"' LABEL "Esci Ora"
  811.     endgroup
  812.    endgroup
  813.  
  814.   if messalina=1 then view ID MESSO HELP '"Messaggio del giorno e stato dei mirror"' FILE "t:mess"
  815.  
  816.  endgroup
  817. endwindow
  818.  
  819. address YAMEXP method ID ZAM MUIM_List_Clear
  820.  
  821. return
  822.  
  823.  
  824.  
  825. removazzo:
  826. MUIV_List_Remove_Selected = -3
  827. List_Remove = 0x8042647e
  828. address YAMEXP method ID SELEN List_Remove MUIV_List_Remove_Selected
  829. address YAMEXP list ID SELEN MUIA_List_Entries
  830. diddio=result
  831. address YAMEXP text ID NFIFFI LABEL diddio
  832. sizzini=0
  833. do lilli=0 TO diddio
  834.    address YAMEXP list ID SELEN POS lilli
  835.    aca=result
  836.    aca=translate(aca,' ',',')
  837.    sdimension=word(aca,3)
  838.    call carla
  839.    sizzini=sizzini+sdimension
  840.    address YAMEXP text ID NSIZZI LABEL sizzini
  841. end
  842. return
  843.  
  844.  
  845. selezionazzi:
  846.  
  847. address YAMEXP text ID NFIFFI
  848. fiffini=result
  849. address YAMEXP text ID NSIZZI
  850. sizzini=result
  851.  
  852. do forever
  853.    address YAMEXP list ID ZAM
  854.    entrata=result
  855.  
  856.    if entrata='' then return
  857.  
  858.    aca=translate(entrata,' ',',')
  859.  
  860.    sdimension=word(aca,3)
  861.    call carla
  862.  
  863.    sizzini=sizzini+sdimension
  864.    address YAMEXP text ID NSIZZI LABEL sizzini
  865.  
  866.    fiffini=fiffini+1
  867.    address YAMEXP text ID NFIFFI LABEL fiffini
  868.  
  869.    address YAMEXP list ID SELEN INSERT POS MUIV_List_Insert_Bottom STRING entrata
  870. end
  871. return
  872.  
  873.  
  874. fokkolo:
  875.  
  876. statino=' Sto creando il file batch. Aspetta un attimo...'
  877. address YAMEXP text ID STATUS LABEL statino
  878.  
  879. popasl ID BACIO
  880. batchfile=result
  881. check ID FB
  882. baffone=result
  883. check ID RIB
  884. raffone=result
  885.  
  886. address YAMEXP list ID SELEN MUIA_List_Entries
  887. quanti=result
  888.  
  889. address YAMEXP string ID DIRRA
  890. amidir=result
  891.  
  892. select
  893.       when baffone=1 then do
  894.                           if ~open(sfatti,batchfile,'A') then do
  895.                                                               call open(sfatti,batchfile,'W')
  896.                                                               end
  897.                           end
  898.       when baffone=0 then call open(sfatti,batchfile,'W')
  899. end
  900.  
  901. do lilli=0 TO quanti
  902.  
  903.    address YAMEXP list ID SELEN POS lilli
  904.    aca=result
  905.  
  906.    if aca='' then do
  907.                   call close(sfatti)
  908.                   statino=' File Batch creato. Pronto a servirti...'
  909.                   address YAMEXP text ID STATUS LABEL statino
  910.                   return
  911.                   end
  912.  
  913.    aca=translate(aca,' ',',')
  914.  
  915.    sdimension=word(aca,3)
  916.    call carla
  917.  
  918.    sfiletto=amidir||word(aca,2)||'/'word(aca,1)||'|'sdimension
  919.    call writeln(sfatti,sfiletto)
  920.  
  921.    if raffone=1 then do
  922.                      rerra=word(aca,1)
  923.                      ciccia=verify(rerra,'.','m')
  924.                      rerre=left(rerra,ciccia)
  925.                      sfiletto=amidir||word(aca,2)||'/'||rerre||'readme|0'
  926.                      call writeln(sfatti,sfiletto)
  927.                      end
  928.  
  929. end
  930.  
  931. return
  932.  
  933.  
  934.  
  935. makkolo:
  936.  
  937. check ID RIB
  938. raffone=result
  939.  
  940. address YAMEXP list ID SELEN MUIA_List_Entries
  941. quanti=result
  942.  
  943. address YAMEXP string ID DIRRA
  944. amidir=result
  945.  
  946. call open(fatti,'t:ppp','W')
  947.  
  948. address YAMEXP poplist ID FTPP
  949. sytollo=result
  950.  
  951. connessozzo='connect' sytollo
  952.  
  953. call writeln(fatti,connessozzo)
  954. call writeln(fatti,'uuencode')
  955.  
  956. do lilli=0 TO quanti
  957.  
  958.    address YAMEXP list ID SELEN POS lilli
  959.    aca=result
  960.  
  961.    if aca='' then do
  962.                   call writeln(fatti,'quit')
  963.                   call close(fatti)
  964.  
  965.                   address 'YAM'
  966.  
  967.                   mailwrite
  968.  
  969.                   address YAMEXP poplist ID SFTP
  970.                   zftpmazzo=result
  971.  
  972.                   writemailto zftpmazzo
  973.  
  974.                   subbolo='"Aminet files"'
  975.  
  976.                   writesubject subbolo
  977.                   writeletter 't:ppp'
  978.                   writequeue
  979.                   address YAMEXP
  980.                   return
  981.                   end
  982.  
  983.    aca=translate(aca,' ',',')
  984.  
  985.    diritto='ls' amidir || word(aca,2)
  986.    filetto='get' word(aca,1)
  987.    call writeln(fatti,diritto)
  988.    call writeln(fatti,filetto)
  989.  
  990.    if raffone=1 then do
  991.                      call writeln(fatti,diritto)
  992.                      rerra=word(aca,1)
  993.                      ciccia=verify(rerra,'.','m')
  994.                      rerre=left(rerra,ciccia)
  995.                      filetto='get' rerre||'readme'
  996.                      call writeln(fatti,filetto)
  997.                      end
  998.  
  999. end
  1000.  
  1001. return
  1002.  
  1003. /* Listatori */
  1004.  
  1005. ritodrl:
  1006. address YAMEXP method ID ZAM MUIM_List_Clear
  1007. address YAMEXP text ID TIPPO LABEL "Gli upload di questa settimana su Aminet"
  1008. call open(ftodrl,'t:todrl','R')
  1009. call rito
  1010. call close(ftodrl)
  1011. return
  1012.  
  1013. riwekmd:
  1014. address YAMEXP method ID ZAM MUIM_List_Clear
  1015. address YAMEXP text ID TIPPO LABEL "I file più richiesti da Aminet durante la settimana"
  1016. call open(ftodrl,'t:wekmd','R')
  1017. call rito
  1018. call close(ftodrl)
  1019. return
  1020.  
  1021. riwekch:
  1022. address YAMEXP method ID ZAM MUIM_List_Clear
  1023. address YAMEXP text ID TIPPO LABEL "I programmi più votati durante la settimana"
  1024. call open(ftodrl,'t:wekch','R')
  1025. call rito
  1026. call close(ftodrl)
  1027. return
  1028.  
  1029. rito:
  1030. ciulone=0
  1031. siulone=0
  1032. do until EOF(ftodrl)
  1033.    bazz=readln(ftodrl)
  1034.    if ((bazz=',,,0,') | (bazz=',,,,')) then do
  1035.                                             ciulone=ciulone-1
  1036.                                             address YAMEXP text ID SNFIFFI LABEL ciulone
  1037.                                             end
  1038.                                        else do
  1039.                                             aca=translate(bazz,' ',',')
  1040.                                             sdimension=word(aca,3)
  1041.                                             call carla
  1042.                                             siulone=siulone+sdimension
  1043.                                             address YAMEXP text ID SNSIZZI LABEL siulone
  1044.  
  1045.                                             ciulone=ciulone+1
  1046.                                             address YAMEXP text ID SNFIFFI LABEL ciulone
  1047.                                             address YAMEXP list ID ZAM INSERT POS MUIV_List_Insert_Bottom STRING bazz
  1048.                                             end
  1049. end
  1050. return
  1051.  
  1052.  
  1053. spezzettazza:
  1054.  
  1055. parse arg lines
  1056.  
  1057. prendimi=readln(carmelozza)
  1058.  
  1059. do until prendimi=lines
  1060.          prendimi=readln(carmelozza)
  1061.          end
  1062.  
  1063. do until lines=''
  1064.          lines=readln(carmelozza)
  1065.  
  1066.          fsfile=substr(lines,1,18)
  1067.          fsfile=compress(fsfile,' ')
  1068.          fsdir=substr(lines,20,10)
  1069.          fsdir=compress(fsdir,' ')
  1070.  
  1071.          fssize=substr(lines,31,4)
  1072.  
  1073.          fssize=compress(fssize,' ')
  1074.          fsdescription=substr(lines,36,44)
  1075.  
  1076.          fsage=0
  1077.  
  1078.          if gibbo=1 then do
  1079.                          fsage=substr(lines,36,3)
  1080.                          fsage=compress(fsage,' ')
  1081.                          fsdescription=substr(lines,40,40)
  1082.                          end
  1083.  
  1084.          fsdescription=compress(fsdescription,',')
  1085.  
  1086.          bazz=fsfile || ',' || fsdir || ',' || fssize || ',' || fsage || ',' || fsdescription
  1087.          writeln(feffeo,bazz)
  1088.          end
  1089. return
  1090.  
  1091.  
  1092. faiftp:
  1093.  
  1094. address 'YAM'
  1095. show
  1096. getmailinfo from
  1097. vediamxo=compare(result,frommo)
  1098.  
  1099. if vediamxo~=0 then do
  1100.                     address YAM 'request "'error1'" "_Oh scusa"'
  1101.                     exit
  1102.                     end
  1103.  
  1104.                else do
  1105.                     statino=' Sto creando la lista degli archivi. Aspetta un attimo...'
  1106.                     address YAMEXP text ID STATUS LABEL statino
  1107.  
  1108.                     getmailinfo file
  1109.                     call open(carmelosa,result,'R')
  1110.                     call open(angelosa,'t:today','W')
  1111.  
  1112.                     do until EOF(carmelosa)
  1113.                        sxs=readln(carmelosa)
  1114.                        writeln(angelosa,sxs)
  1115.                        end
  1116.  
  1117.                     call close(angelosa)
  1118.                     call close(carmelosa)
  1119.  
  1120.                     messalina=0
  1121.                     getmailinfo sub
  1122.                     eccolo=result
  1123.                     nome=right(result,11)
  1124.                     nome=strip(nome)
  1125.                     daten=nome
  1126.  
  1127.                     if find(eccolo,giornal) then do
  1128.                                                  tipox=0
  1129.                                                  gibbo=0
  1130.                                                  call open(carmelozza,'t:today','R')
  1131.                                                  call open(feffeo,'t:todrl','W')
  1132.                                                  call spezzettazza(primadeifili)
  1133.                                                  call close(feffeo)
  1134.  
  1135.                                                   call open(feffeo,'t:mess','W')
  1136.                                                   do until EOF(carmelozza)
  1137.                                                      lizeazza=readln(carmelozza)
  1138.                                                      if lizeazza=msgday | lizeazza=msgmir then do
  1139.                                                                                                messalina=1
  1140.                                                                                                writeln(feffeo,lizeazza)
  1141.                                                                                                lizeazza=readln(carmelozza)
  1142.                                                                                                end
  1143.                                                      writeln(feffeo,lizeazza)
  1144.                                                      end
  1145.                                                   call close(feffeo)
  1146.                                                  call close(carmelozza)
  1147.  
  1148.                                                  call winsozz
  1149.                                                  address YAMEXP text ID TIPPO LABEL "Gli upload del giorno su Aminet"
  1150.                                                  address YAMEXP text ID DATTO LABEL daten
  1151.                                                  call open(ftodrl,'t:todrl','R')
  1152.                                                  call rito
  1153.                                                  call close(ftodrl)
  1154.                                                  end
  1155.  
  1156.                      if find(eccolo,settima) then do
  1157.                                                   tipox=1
  1158.                                                   call open(carmelozza,'t:today','R')
  1159.                                                   gibbo=0
  1160.                                                   call open(feffeo,'t:todrl','W')
  1161.                                                   call spezzettazza(primadeifili)
  1162.                                                   call close(feffeo)
  1163.  
  1164.                                                   gibbo=1
  1165.                                                   call open(feffeo,'t:wekmd','W')
  1166.                                                   call spezzettazza(primadeifilis)
  1167.                                                   call close(feffeo)
  1168.  
  1169.                                                   gibbo=1
  1170.                                                   call open(feffeo,'t:wekch','W')
  1171.                                                   call spezzettazza(primadeifilis)
  1172.                                                   call close(feffeo)
  1173.  
  1174.                                                   call open(feffeo,'t:mess','W')
  1175.                                                   do until EOF(carmelozza)
  1176.                                                      lizeazza=readln(carmelozza)
  1177.                                                      if lizeazza=msgday | lizeazza=msgmir then do
  1178.                                                                                                messalina=1
  1179.                                                                                                writeln(feffeo,lizeazza)
  1180.                                                                                                lizeazza=readln(carmelozza)
  1181.                                                                                                end
  1182.                                                      writeln(feffeo,lizeazza)
  1183.                                                      end
  1184.                                                   call close(feffeo)
  1185.  
  1186.                                                   call close(carmelozza)
  1187.                                                   call winsozz
  1188.                                                   address YAMEXP text ID TIPPO LABEL "Gli upload della settimana su Aminet"
  1189.                                                   address YAMEXP text ID DATTO LABEL daten
  1190.  
  1191.                                                   call open(ftodrl,'t:todrl','R')
  1192.                                                   call rito
  1193.                                                   call close(ftodrl)
  1194.                                                   end
  1195.  
  1196.                     statino=' Ora puoi selezionare gli archivi...'
  1197.                     address YAMEXP text ID STATUS LABEL statino
  1198.                     end
  1199. return
  1200.  
  1201. carla:
  1202. select
  1203.   when pos('K',sdimension)>0 then do
  1204.                                   sdimension=strip(sdimension,,'K')
  1205.                                   sdimension=sdimension || '000'
  1206.                                   end
  1207.   when pos('M',sdimension)>0 then do
  1208.                                   sdimension=strip(sdimension,,'M')
  1209.                                   if pos('.',sdimension)>0 then do
  1210.                                                                 sdimension=compress(sdimension,'.')
  1211.                                                                 sdimension=sdimension || '00'
  1212.                                                                 end
  1213.                                                            else do
  1214.                                                                 sdimension=sdimension || '000'
  1215.                                                                 end
  1216.                                    sdimension=sdimension || '000'
  1217.                                    end
  1218.   otherwise sdimension=0
  1219. end
  1220. return
  1221.