1. 2011
    Nov
    24

    Syndication feeds from templates

    One of the must-have necessities for any blogging or other web publishing software is the RSS (Really Simple Syndication) feed. RSS, or its younger and sexier sibling Atom, is the file format used by news aggregators, which give you a frequent listing of posts and stories published by your favorite blogs, newspapers, journals, whatever you want, without you having to actually go to their website. Usually the RSS feed is generated by some library of code where you construct your feed as an array of objects or data structures. Here's how you put together an RSS feed with PyRSS2Gen, for instance:

    rss = PyRSS2Gen.RSS2(
        title = "Andrew's PyRSS2Gen feed",
        link = "http://www.dalkescientific.com/Python/PyRSS2Gen.html",
        description = "The latest news about PyRSS2Gen, a Python library for generating RSS2 feeds",
    
        lastBuildDate = datetime.datetime.now(),
    
        items = [
           PyRSS2Gen.RSSItem(
             title = "PyRSS2Gen-0.0 released",
             link = "http://www.dalkescientific.com/news/030906-PyRSS2Gen.html",
             description = "Dalke Scientific today announced PyRSS2Gen-0.0, a library for generating RSS feeds for Python.  ",
             guid = PyRSS2Gen.Guid("http://www.dalkescientific.com/news/030906-PyRSS2Gen.html"),
             pubDate = datetime.datetime(2003, 9, 6, 21, 31)),
           PyRSS2Gen.RSSItem(
             title = "Thoughts on RSS feeds for bioinformatics",
             link = "http://www.dalkescientific.com/writings/diary/archive/2003/09 …
  2. 2009
    May
    08

    RSS yay?

    I’ve been working on this for a while now, and finally my blog has a functional RSS feed. It’s the super-ghetto RSS2 format, rather than the newer, slicker (and more complex) Atom, though, so nice things like, I don’t know, HTML(!!) are a no-go, and it’s not even W3C standard compliant, but it works with my RSS reader which is good enough to start with. Use at your own risk.

    And not to worry, someday I’ll do this properly and set up an Atom feed.