Here a little script that uses curl to download the latest documentation from Sourceforge and keeps the date and time of the files locally:

   /*
   ---rgf, 2022-07-02: get downloadable doc files and download them
   here the relevant portions of the download URLs that the server returns:
   ...
   <th scope="row" headers="files_name_h"><a 
href="https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0beta/readme.pdf/download";  title="Click to 
download readme.pdf">
   <th scope="row" headers="files_name_h"><a 
href="https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0beta/ReadMe.txt/download";  title="Click to 
download ReadMe.txt">
   ...
   --
   */

   say "getting and parsing download URLs ..."
   url="https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0beta/";
   cmd="curl --silent --list-only" url
   say "cmd:" pp(cmd)
   outArr=.array~new
   address system cmd with output using (outArr)

   data=outArr~makeString
   resArr=.array~new
   do counter c while data<>""
       -- as of 2022-07-02:
       parse var data '"files_name_h"><a href="' url '/download" title' data
       if url<>"" then resArr~append(url)
                  else leave
       say "#" c~right(2)":" pp(url)
   end
   say
   say "downloading ..."
   do counter c item over resArr
       -- cmd="wget --no-check-certificate" item
       cmd="curl --silent --remote-time -L -O" item
       say "#" c~right(2)":" pp(cmd) "..."
       address system cmd with error using (.array~new)
   end
   say "done"


   ::routine pp
      return "["arg(1)"]"

This script replaces an older one that used "wget". Using "curl" instead as it is now available on all major operating systems.

---rony

_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to