• SCript

    From Sean Dennis@1:18/200 to All on Friday, May 03, 2019 09:38:22
    Hello All,

    So I couldn't stop until I figured this out...so here's the full script that I wrote to get the ARRL Letter into text:

    links -dump -codepage cp437 "http://www.arrl.org/arrlletter?issue=current" > letter
    ### Remove extra lines from the top
    sed -i '1,42d' letter
    ### Remove additional extra lines from the top
    sed -i '4,8d' letter
    ### Remove line that contains "www.arrl.org"
    ### and everything else to the end of the file
    sed -i '/www.arrl.org/,$d' letter
    ### Remove the word "Ad"
    sed -i 's/\<Ad\>//g' letter

    (The second line will probably be wrapped when this goes out.)

    The only issue I'm having is the codepage with some of the characters but I'll figure that out.

    A quick note about sed: I am using the "inline" mode which means it works directly on the file for changes. I could send the output of the command to another file but in this case it is not necessary.

    I'll explain how the script works:

    - I use the links text-based web browser to grab the actual HTML page and convert it to text. I am still having issues with the codepage but I am working on it.
    - The script removes the top 42 lines. This is cruft from converting from HTML.
    - Then additional blank lines and one line of cruft is removed.
    - At the very end of the actual information we want, there is a line that reads "www.arrl.org". The script removes that line and everything down to the end of the file.
    - Then cruft that shows the word "Ad" is removed.

    There is an additional line not on here that calls my BBS's internal text file posting program to post the file to the BBS.

    I'm going to set this up to run every Friday at 6 AM. Let's see if this works. :D


    ... Inspiration is sometimes another name for desperation.
    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: Outpost BBS * Limestone, TN, USA (1:18/200)