Monday, May 5, 2008

feed-cli: A Really Simple way to generate RSS feeds


I've just released feed-cli: a Really Simple way to generate RSS feeds from the command line. This program is implemented in Haskell :)

feed-cli generates RSS 2.0 feeds based on command line arguments. Use it to create and update feeds from shell scripts, build scripts, cron jobs, CGIs, or other programs instead of using a library.

Some Examples
  • create an empty feed:
    ./feed-cli new-feed -tTitleOfFeed -d"Feed Description" \
      -o/tmp/feed.xml  -lhttp://www.syntaxpolice.org
    
  • add an item to that feed
    ./feed-cli new-item -t"entry of the day" -d"This is a description of this feed item." \
       -u/tmp/feed.xml  -lhttp://www.syntaxpolice.org
    
  • pipe a command into a feed item
    ls -l | ./feed-cli new-item --pre --pipe-mode -t"directory contents" \
      -u/tmp/feed.xml  -lhttp://www.syntaxpolice.org
    
    You can get feed-cli from Hackage, the Haskell Package system, along with it's dependencies, xml and feed. Or you can use my darcs repo. It also requires ghc 6.8, but that's not for any deep reason. If you have cabal-install installed, you should be able to "cabal install feed-cli".

    The idea is to make generating feeds as simple as possible, so feel free to package it for your favorite OS :)

    It should be pretty simple to support atom feeds as well, since the feed library already does that. I'd like to extend the feed library itself with more functionality along the lines that feed-cli implements - adding feed items, limiting the number of items in a feed, etc. Simple feed transformers. I think this is what Sigbjorn had in mind when he wrote the feed library.

    Thanks to my company, Galois for releasing xml & feed.

    Try it out and leave a comment or send an email and tell me about how you use it and whether there are more features that you need.
  • No comments:

    Post a Comment

    Post a Comment