tags:

views:

118

answers:

3

I have a list if these 3 items: title and link and a html based description and I am looking for a library or external tool which can be fed these 3 items and create a rss xml page. Does such a thing exist?

+1  A: 

How about django's RSS Framework?

S.Mark
+1  A: 

This might not be the answer you search for, but any RSS dialect is a fairly simple standard (holding for 0.9 and 2 especially, and with constraints for 1, too).

You could consider writing it by hand, if you don't have any additional constraints (like, you already use Django, or it will get more complex in the nearer future, or it should automatically be distributed, or you want to create RSS 1, RSS 2 and Atom all at once and don't have the time to read 3 specs).

Specifications:

Boldewyn
+2  A: 

I suggest you use a template and feed the list of items to the template.

Example Jinja2 template (Atom, not RSS, but you get the idea), assuming that the items are 3-tuples (title, link, html):

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"&gt;
    <author>Author's name</author>
    <title>Feed title</title>
    {%for item in items %}
    <entry>
        <title>{{item[0]}}</title>
        <link href="{{item[1]}}"/>
        <content type="html">{{item[2]}}</content>
    </entry>
    {%endfor%}
</feed>

Code to feed content to the template and output the result:

import jinja2
env = jinja2.Environment(loader=jinja2.FileSystemLoader("."))
print env.get_template("feedtemplate.xml").render(items=get_list_of_items())
codeape