Writing An RSS Feed Generator

submited by
Style Pass
2024-10-12 03:30:02

RSS is just a big string. You can write an RSS feed using print or its equivalent in your language.

Andrew's RSS feed generator is the second one I've written. The first, neatly, was for Hacker News (not the official one or anything, just one I wrote).

The format's simple enough. There's a standard header: <?xml version="1.0"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> At the bottom of the whole kit and kaboodle is a closer for the channel element: </channel> In between there's a whole lot of elements called items. They can have a lot of elements inside. I kept it simple this time: <title>%s</title>\n"+ "\t<link>%s</link>\n"+ "\t<description>%s</description>\n"+ "\t<generator>Andrew</generator>

Leave a Comment