λFeed

λFeed is an RSS 2.0 feed generator. It reads news items - in a non-XML, human-friendly format - distributed over multiple channels and renders them into the RSS 2.0 XML format understood by most news aggregators as well as into HTML for inclusion into web pages.

λFeed is written in Haskell 98; i.e., it should work with any Haskell system that supports the hierarchical libraries and on any operating system. However, I have only tested it with the Glasgow Haskell Compiler (GHC) on GNU/Linux. I'd appreciate any comments or patches concerning use with other Haskell systems and operating systems.

Code

All code is available via darcs.

darcs get http://www.cse.unsw.edu.au/~pls/repos/lambdaFeed/

λFeed uses a cabal-based build system; i.e, use the following sequence of commands to compile and install:

% chmod a+x Setup.hs VersionTool.hs runLambdaFeed.hs
% ./VersionTool.hs Config.hs
% ./Setup.hs configure --prefix=INSTALL-DIRECTORY
% ./Setup.hs build
% ./Setup.hs install

Alternatively, you can simply invoke runLambdaFeed.hs inplace - after adding execute permissions and running `VersionTool.hs' as above. (This will use interpreted, rather than compiled code, and hence be significantly slower.)

Documentation

λFeed is in its infancy; so, there is currently no proper manual. Some basic information appears below.

Invoking λFeed: command line options

Invoke λFeed with the option --help to get a list of supported command line options and a brief description of their meaning. If you compiled the tool, the executable will be named lambdaFeed; hence, you would run

lambdaFeed --help

to get the option description.

Channel descriptions and news items

λFeed reads news items from a number of channels (which may, for example, be used to group items by topic area). Each channel is characterised by a channel description in a file ending on .lfc. The entries of a channel description correspond to the elements of channel specifications in RSS 2.0. As an example, consider polarbear.lcf.

λFeed looks for channel descriptions in a feed directory, which by default is the current directory, but can be any directory specified with the command line option --feed=FEED-DIR. Each channel description must specify an items directory using an entry of the form Items: ITEMS-DIR. That items directory contains all the news items of that channel. In polarbear.lcf, the items directory is polar/, located inside the feed directory - however, in general, item directories can be anywhere, also outside the feed directory.

Each file ending on .lfi in an items directory is a news item whose entries correspond to the elements of item specifications in RSS 2.0. As an example, consider morefish.lfi. All news items have a publication date. Either by an explicit pubDate entry or its file modification time. In the later case, λFeed will append the file modification date as a pubDate entry to the news item (when it first reads it), so that the date remains stable under changes

For more details on the input format, see the header of the file LambdaFeed.hs.

Current Limitations

λFeed cannot do the following things, although they would be useful and are in fact not hard to implement:

  • It can't merge or filter channels.
  • It cannot read channels in RSS 2.0 XML format. (It currently only outputs that format.)
  • It cannot be directly run as a CGI script. (But it's easy to write CGI shell scripts wrapping λFeed.)
  • It cannot generate atom feeds. (But there are tools and websites converting between RSS 2.0 and atom.)

• Copyright 2006 Manuel M T Chakravarty • Last modified: Thu Jun 8 16:09:11 EDT 2006