Creating RSS 2.0 Feeds
RSS 0.91 and 0.92 feeds are created in the same way; the additional elements found in 0.92 are well-handled by the existing RSS tools.
Of course, you can always hand-code your RSS feed. Doing so certainly gets you on top of the standard, but it’s neither convenient, quick, nor recommended. Ordinarily, feeds are created by a small program in one of the scripting languages: Perl, PHP, Python, etc. Many CMSs already create RSS feeds automatically, but you may want to create a feed in another context. Hey, you might even write your own CMS!
There are various ways to create a feed, all of which are used in real life:
- XML transformation
Running a transformation on an XML master document converts the relevant parts into RSS. This technique is used in Apache Axkit-based systems, for example.
- Templates
You can substitute values within a RSS feed template. This technique is used within most weblogging platforms, for example.
- An RSS-specific module or class within a scripting language
This method is used within hundreds of little ad hoc scripts across the Net, for example.
We’ll look at all three methods, but
let’s start with the third, using an RSS-specific
module. In this case, it’s Perl’s
XML::RSS.
Creating RSS with Perl Using XML::RSS
The XML::RSS module is one of the key tools in the
Perl RSS world. It is built on top of
XML::Parser—the basis for many Perl XML
modules—and is object-oriented. Actually,
XML::RSS also supports the creation of the older versions of RSS, plus ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access