TIP: Click on subject to list as thread! ANSI
echo: ham
to: All
from: Sean Dennis
date: 2019-05-03 09:38:22
subject: SCript

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:

#!/bin/bash
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/\//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

Later,
Sean

... Inspiration is sometimes another name for desperation.
--- GoldED+/LNX 1.1.5-b20180707
* Origin: Outpost BBS * Limestone, TN, USA (1:18/200)
SEEN-BY: 1/19 123 15/2 16/0 18/200 120/544 123/130 131 142/926 203/0 221/0 1 6
SEEN-BY: 221/360 226/16 17 229/200 312 354 426 728 1014 240/1120 2100 5138
SEEN-BY: 240/5832 5853 249/206 317 400 261/38 280/5003 292/854 317/3 320/119
SEEN-BY: 320/219 322/0 757 342/200 393/68 460/58 633/267 280 640/1321 1384
SEEN-BY: 712/620 848 886 770/1 2432/390 2452/250 2454/119
@PATH: 18/200 229/426 240/5832 320/219 221/1 640/1384 712/848 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.