Release: CBC News App (RSS Reader)

Basic and Machine Language

Moderator: Moderators

Bobbi
Vic 20 Afficionado
Posts: 347
Joined: Thu Oct 13, 2016 11:35 am
Location: Toronto
Occupation: Programmer

Release: CBC News App (RSS Reader)

Postby Bobbi » Tue Dec 13, 2016 3:34 pm

VIC-20 RSS Reader

Hardware Requirements

- VIC-20 + 32K expansion
- User-port modem
- Some way to load the program (disk, tape, SD2IEC)

I developed and tested this code using the WiModem from cbmstuff.com (Jim Drew). It should also work with other Internet modems that are able to 'dial' URLs using the following syntax:

Code: Select all

ATDT www.cbc.ca:80


I use an SD2IEC type drive, but as long as you can load the executable the type of drive is unimportant.

Modem Setup

Be sure to set your modem for 300 baud operation. Usually this is done using the following Hayes commands in a terminal program:

Code: Select all

 
 AT*B300
 AT&W

The second command saves the settings - you may decide not to do this, but it makes power cycling the system much more convenient when you do not have to keep resetting the baud rate.

How to Run

Run RSS.PRG as follows:

Code: Select all

LOAD"RSS.PRG",8
RUN


20161213_154724.jpg
Main menu


You can select one of four CBC news RSS feeds using the function keys. The RSS reader will then 'dial' the website and make an HTTP request for the XML page containing the RSS news feed.

20161213_154818.jpg
Initial loading of data


If all is well, the screen will clear, then you should see a row of dots followed by the text:
HTTP/1.1 200 OK
and then a few more lines of response from the web server. The RSS reader shows you the first 100 characters of response in order to help debug broken connections. After four lines or so, the RSS reader will stop echoing the output and will begin parsing the data stream (which is assumed to be the XML document containing the RSS data.) As the code parses the input it shows a simple spinner. A horizontal blue bar is shown when a new story tag is encountered. After 30 seconds or so, the first story will be displayed, and then parsing will continue for the following stories in the feed.

20161213_154856.jpg
Formatted article


Problems?

If there are problems with your setup you may be able to diagnose them with the aid of the first 100 characters of output displayed above. Additionally, the display or LED on your modem can help you determine if a connection was successfully established or not.

This code is very much of alpha quality and has some known bugs. It often crashes or displays corrupt output. In particular some UTF-8 characters in the RSS feed can mess up the screen. Don't trust your life or your livelihood to it!

20161213_154610.jpg
WiModem
Attachments
rss-0.1.zip
RSS reader application
(4.37 KiB) Downloaded 10 times

User avatar
akator
Vic 20 Devotee
Posts: 229
Joined: Wed Apr 14, 2010 6:01 pm

Re: Release: CBC News App (RSS Reader)

Postby akator » Tue Dec 13, 2016 7:45 pm

Super cool. Now I have to add one of those WiModems to my wish list so I can use this :D

User avatar
beamrider
Vic 20 Nerd
Posts: 802
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Release: CBC News App (RSS Reader)

Postby beamrider » Wed Dec 14, 2016 6:18 am

Magnificent.. will give it a try this weekend.

Bobbi
Vic 20 Afficionado
Posts: 347
Joined: Thu Oct 13, 2016 11:35 am
Location: Toronto
Occupation: Programmer

Re: Release: CBC News App (RSS Reader)

Postby Bobbi » Sat Dec 17, 2016 2:13 pm

I am curious to know if anyone gave this a try?

I am still investigating what I have to do to make it more reliable and to work at 1200 baud. It is a shame the RS232 routines in the Kernal are such a mess!

User avatar
joshuadenmark
Big Mover
Posts: 897
Joined: Sat Oct 23, 2010 11:32 am
Location: Denmark
Occupation: Copier technician

Re: Release: CBC News App (RSS Reader)

Postby joshuadenmark » Sat Dec 17, 2016 2:34 pm

Bobbi wrote:I am curious to know if anyone gave this a try?

I am still investigating what I have to do to make it more reliable and to work at 1200 baud. It is a shame the RS232 routines in the Kernal are such a mess!

haven't got a modem... :cry:
Kind regards, Peter.
____________________________________________________
In need of a wiki logon - PM me

Bobbi
Vic 20 Afficionado
Posts: 347
Joined: Thu Oct 13, 2016 11:35 am
Location: Toronto
Occupation: Programmer

Re: Release: CBC News App (RSS Reader)

Postby Bobbi » Sat Dec 17, 2016 2:47 pm

I have been having fun with the WiModem. I totally recommend it if you can find the cash for it ($55 US for the version with the screen.)

User avatar
akator
Vic 20 Devotee
Posts: 229
Joined: Wed Apr 14, 2010 6:01 pm

Re: Release: CBC News App (RSS Reader)

Postby akator » Sat Dec 17, 2016 3:58 pm

After the holidays I hope to buy a WiModem and play with this. The whole idea is very cool.

I keep wondering if there is some way to use the WiModem to access a "chat room" using our VICs. Probably completely impractical, but that doesn't stop me from thinking about it. :)

Bobbi
Vic 20 Afficionado
Posts: 347
Joined: Thu Oct 13, 2016 11:35 am
Location: Toronto
Occupation: Programmer

Re: Release: CBC News App (RSS Reader)

Postby Bobbi » Sat Dec 17, 2016 4:00 pm

Seems like a practical idea to me. You can do live chat on BBS systems (sysop to single logged in user) but I don't see why an irc client is impossible for example.

I am looking into making a telnet client for the VIC-20 once I get my RS-232 flow control sorted out!

Bobbi
Vic 20 Afficionado
Posts: 347
Joined: Thu Oct 13, 2016 11:35 am
Location: Toronto
Occupation: Programmer

Re: Release: CBC News App (RSS Reader)

Postby Bobbi » Sun Dec 18, 2016 10:38 am

New interim release (v0.2) attached.

Changes since v0.1:

1) Reduced oversized (20K) display buffer that had the potential to trash the RS232 buffers (but I don't think it was a problem in practice.) Added some paranoia to make sure we don't run off the end of the allocated buffer space.

2) Added handling to terminate program when </channel> tag is seen.

3) Added debug code to flash the border for every 10 characters read. If the border is flashing, RS232 data is being received.

4) Added debug code to print out a period when the RS232 RX buffer has more than 10 chars, an 'x' more than 100 chars and an 'X' more than 200 chars. This is to verify I am not letting the RS232 RX buffer overflow. I am not, as far as I can tell.

This release is reasonably reliable at 300 baud, but I have not had much luck yet with 600 or 1200 baud.
Attachments
rss-0.2.zip
RSS Reader / CBC News App v0.2
(4.58 KiB) Downloaded 11 times

User avatar
litody
Vic 20 Amateur
Posts: 51
Joined: Sat Jan 04, 2014 3:10 am
Location: England

Re: Release: CBC News App (RSS Reader)

Postby litody » Sun Dec 18, 2016 1:42 pm

This looks such a cool application that I have just placed my order for a Wimodem. I can't wait to start playing around with this and the modem, can't quite believe my VIC will be able to talk to (or at least listen to) the outside world. :)

Bobbi
Vic 20 Afficionado
Posts: 347
Joined: Thu Oct 13, 2016 11:35 am
Location: Toronto
Occupation: Programmer

Re: Release: CBC News App (RSS Reader)

Postby Bobbi » Mon Dec 19, 2016 8:16 am

I got 1200 baud working reasonably reliably last night, but I still need to do a bit of work to get it into a releasable state.

Bobbi
Vic 20 Afficionado
Posts: 347
Joined: Thu Oct 13, 2016 11:35 am
Location: Toronto
Occupation: Programmer

Re: Release: CBC News App (RSS Reader)

Postby Bobbi » Sun Feb 05, 2017 10:15 pm

Here is v0.3 for the VIC-20 (and also for the C64.) Instructions are included in the ZIP file.

Works at 1200 baud (and expects the WiModem to have been set to 1200 baud ahead of time.)

This code seems to be reliable on the C64 but not on the VIC-20 (although it works reasonably well on the VIC too). On the VIC-20 we lose some characters on occasion due to the broken X-wire RS232 flow control in the kernal.
Attachments
rss-0.3.zip
(8.42 KiB) Downloaded 6 times

Bobbi
Vic 20 Afficionado
Posts: 347
Joined: Thu Oct 13, 2016 11:35 am
Location: Toronto
Occupation: Programmer

Re: Release: CBC News App (RSS Reader)

Postby Bobbi » Mon Feb 06, 2017 6:11 pm

Here is v0.4 with some improvements. Eight feeds to choose from now. Still not reliable on VIC-20 for reasons mentioned above, but works pretty well on C64.
Attachments
rss-0.4.zip
(9.07 KiB) Downloaded 5 times

Bobbi
Vic 20 Afficionado
Posts: 347
Joined: Thu Oct 13, 2016 11:35 am
Location: Toronto
Occupation: Programmer

Re: Release: CBC News App (RSS Reader)

Postby Bobbi » Fri Feb 10, 2017 2:57 pm

Here is v0.5 with some further improvements, including a 'kiosk mode' that cycles through all the RSS feeds forever. The program is now working very well on C64 but still has some issues with flaky RS232 on VIC-20.
Attachments
rss-0.5.zip
(9.16 KiB) Downloaded 6 times

Bobbi
Vic 20 Afficionado
Posts: 347
Joined: Thu Oct 13, 2016 11:35 am
Location: Toronto
Occupation: Programmer

Re: Release: RSS Reader - Internet News on the VIC20

Postby Bobbi » Sun Feb 12, 2017 8:33 pm

Here is v0.6. The big change is that I added the New York Times (so it's not just the CBC News App anymore!)

If anyone has any special requests for RSS feeds to add, drop me a private message!

I did a bunch of testing using srowe's RS-232 wedge. Seems to be working better with the wedge although we still get some corruption. (See here http://sleepingelephant.com/ipw-web/bul ... f=2&t=8307 for details.)
Attachments
rss-0.6.zip
(10.39 KiB) Downloaded 9 times


Return to “Programming”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest