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?
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">
<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())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With