Version 40 of RSS

Updated 2004-06-18 00:30:04

Rich Site Summary [L1 ] or RDF Site Summary [L2 ] or Really Simple Syndication [L3 ] (at least as of RSS 2.0 [L4 ]).

There are some heated debates [L5 ] about what RSS is but at its core it's an XML syntax for providing summaries of news based websites. An RSS document consists of one or more channels with one or more items. Each item is usually a news story with a title, a link and possibly a description. Newer versions of RSS [L6 ] provide for more properties for each item.

SC's Wiki was an early implementation of Wikit with an RSS feed. That is you can get the Recent Changes page as an RSS file.

Now this wiki does as well [L7 ].


TclRSS [L8 ] is a Tcl library for handling RSS (0.91/1.0) files.

MPJ: Here is an example of using TclRSS to read the Recent Changes page.

 package require http
 package require rss
 proc fetch {url} {
    set tok [http::geturl $url]
    set res [http::data $tok]
    http::cleanup $tok
    return $res
 }
 set rawrss [fetch http://mini.net/tcl/rss.xml]
 #set rawrss [fetch http://slashdot.org/slashdot.rss] ;# also works for slashdot
 set channel [rss::parse $rawrss]
 puts "Feed:[$channel title]"
 puts "===="; set count 0
 foreach item [$channel items] {
    puts "[incr count]. [$item title]"
    puts "$count. [$item link]"
    puts "$count. [$item description]"
    puts "===="
 } 

Update (16/06/2004): Playing around with RSS, for a upcoming application RssPoint, I added just a little code to RS's A little XML browser to create A little RSS browser.


LV So, what does one do with RSS? For what purpose does one make data available in this format? For what can one use it that they couldn't just use the html pages?

MR Larry, it lets people easily track updates or changes from a large number of websites very quickly, using an application called a news aggregator. Rather than having to visit 50 websites for news, all the latest headlines are downloaded automatically and shown in a way that makes it very quick to see only what is new, and read just what I want. Since very recently adding it to CourseForum and ProjectForum its been a godsend, letting me monitor dozens of Wiki sites with practically zero effort.


LV Ah, Mark, so it is a format that some applications can interpret and use to display a series of links. Allows one, it appears, to do some sort of dynamic personalization of headlines or whatever the site wants to advertise.

MR Sort of. See e.g. the main window screenshot linked to from http://ranchero.com/netnewswire/


Petteri K offers

    lynx -source http://www.iki.fi/petterik/rss.cgi > rss.cgi
    tclsh rss.cgi 0b00 

as a demonstration of RSS capabilities.

LV I am uncertain what this script is for. When I run it, all I see is a series of lines from ActiveState. I do not seem to see anything from the other URLs listed in the script. I added two URLs - one for Tcler's Wiki and one for Steve's Wiki (listed above) - surely their sites should have shown up in the rss.cgi's output.


A nice discussion from another Wiki [L9 ].


LV What Tcl-related sites provide RSS information? Is the Tcl-URL provided in RSS? Other information? Could the Tcl-URL editors make use of RSS someway?


Scott Gamon - I, for one, would love to see a RSS feed for Tcl-URL. Or a RSS feed for news:comp.lang.tcl .

NEM - Well, your wish is my command. I have a cgi script at http://mod3.net/~nem/cgi-bin/usenetrss.cgi which grabs the latest comp.lang.tcl headlines as an RSS feed. It scrapes groups.google.com for this information. You can also grab an RSS feed for any other group, by appending ?group=<my group> to the URL (e.g. for clta, you would use http://mod3.net/~nem/cgi-bin/usenetrss.cgi?group=comp.lang.tcl.announce ). You might be able to grab an RSS feed of Tcl-URL! in a similar way (or ask DDJ to provide one), but with wiki and clt feeds, you get all the information in Tcl-URL!, just missing the commentary. Oh - one thing. If you use this feed, please note that it only updates once every hour, so please don't try to access it more than that. It sets appropriate Expires and Cache-Control headers if you are going through a cacheing proxy.

escargo 21 Jun 2003 - I tried to connect to your RSS feed using the Feedreader Alpha 2.5 Build 610, but I got a message saying Feed doesn't contain any items. I don't know where the disconnect might be. How would you go about diagnosing this problem?

NEM - Fixed now. I was setting the Content-Length header incorrectly causing some XML to be chopped off. It should all work correctly now.

escargo - Now I see the message "HTTP/1.1 500 Internal Server Error".

NEM - Strange. It works for me, and I'm not seeing anything in the error log. I've added more logging to the script now to see if it breaks again. From the access log, I can see a number of accesses to this CGI, and only the feedreader ones have failed, so maybe it's a feedreader issue? If it happens again, email me and I'll have a look. Probably best to delete this conversation after you have read this. You may possibly have accessed the script when I was messing around with it (naughty me - editing a "live" script).

Scott Gamon - Works great for me. Thanks!

escargo 22 Jun 2003 - I still see the same message. I don't have time to dig into this now, but I may build a script (to fetch the contents of the same URL) and see what the raw results look like. There's probably already something on the wiki that does this. (I can probably grab some of the code from my wish-reaper to do the job.)

NEM - Well, according to my new logs, feedreader is sending the request encoded as text/html --- which the ncgi package chokes on.

escargo 23 Jun 2003 - So is that a Feedreader bug or an ncgi bug?

NEM - I'm not sure. My initial thought is that it is Feedreader that is broken, because I cannot see why you would send the request encoded as HTML, but I could be wrong. I'm not sure which (if any) standard specifies the encoding type to be used.

escargo 29 Jun 2003 - Well, when I use the feed http://mini.net/tcl/rss.xml , Feedreader works just fine, as do all the other sources I tap into with Feedreader.

NEM - OK, in that case, file a bug with the tcllib project at sourceforge.

escargo 30 Jun 2003 - A bug has been filed.


Another tool available for providing a bridge between newsgroups and RSS is http://freshmeat.net/projects/nntp2rss/ .


See also tclog, and giggle (both weblog applications).


Here is a small Tcl script intended to be run as a cron job which checks a series of RSS feeds and sends an email when one is updated. RSS Monitor


I recently noticed an article at http://www.macdevcenter.com/pub/a/mac/2004/03/12/rss_scripting.html which demonstrates some rather basic shell scripts for retrieving and displaying RSS. In the following comments, someone shows a tremendously simple script in REBOL for doing similar functionality, and someone mentions that perl and python both have even better facilities.

Would it be useful to promote the TclRSS extention, mentioned above, into Tcllib?


Category Acronym | Category Internet