Using a 30 year old laptop in 2021:
As the MC400 has no native networking capability we can’t read any websites directly on the machine itself. But, if you attach to another computer that does have a internet access via the serial link(s) then it becomes possible. I could have just used the terminal and read http://news.bbc.co.uk/ directly from the Raspberry Pi command line but I wanted something that felt more integrated with the MC itself. This solution uses classic shell script techniques with curl and sed so doesn’t need any other special packages to be installed.
The shell script gets the BBC RSS/XML news feed via curl and then strips out some of the tags & headers with sed, writing the output to
/home/pi/mc400/NEWS/BBC_NEWS.TXT. There’s no automatic copying over to the MC400 at the moment, to read the news headlines the file has to be accessed manually as
REM::C:\NEWS\BBC_NEWS.TXT. This is possible as I have the DOS “
MCLINK.EXE” running on the Pi in the dosbos-x emulator, but this obviously relies on the Link app running on the MC400. The dosbox-x config uses the USB-serial adapter
COM1 and mounts
It’s a nasty, hacky script, but it works. For now. I’ve created a crontab entry to run this script every 15 mins, and write the top 15 (ish) headlines to a text file.
Shell script –
#!/bin/bash url="http://feeds.bbci.co.uk/news/rss.xml" curl --silent "$url" | grep -E '(title>|description>|link>)' | \ sed -n '4,$p' | \ sed -e 's/ //' -e 's/<title>//' -e 's/<\/title>//' -e 's/<description>/ /' \ -e 's/<\/description>//' -e 's/<link>/ /' -e 's/<\/link>/\n/' \ -e 's/<!\[CDATA\[//' -e 's/\]\]>//' -e 's/?at_medium=RSS&at_campaign=KARANGA//'
2,17,32,47 * * * * /home/pi/src/bbc_news.sh | head -n62 > /home/pi/mc400/NEWS/BBC_NEWS.TXT