PDA

View Full Version : Howto Create an RSS 2.0 Feed


TheDude
01-01-2007, 05:31 AM
If you can learn HTML, you can easily learn how to build your own RSS 2.0 feeds. I'll take you through the steps to creating an RSS feed from scratch.

Step 1: XML Declaration

Since RSS 2.0 must validate as XML, the first line in your rss feed must be the XML declaration.

<?xml version="1.0" encoding="utf-8"?>

The encoding is optional but recommended. If your using something other than UTF-8 be sure to change the above line.

Note: If you are using CFML and have whitespace due to the Application.cfm file you can reset the output buffer using <cfcontent reset="true">

Step 2: RSS Channel

In this step we need to open up the rss tag, and the channel tag, all of your feed content goes inside these tags.

<rss version="2.0">
<channel>

Step 3: RSS Feed Information

Next you place information about your RSS feed such as the title of it, the description, and a link to the the site.

<title>The title of my RSS 2.0 Feed</title>
<link>http://www.example.com/</link>
<description>This is my rss 2 feed description</description>
<lastBuildDate>Mon, 12 Sep 2005 18:37:00 GMT</lastBuildDate>
<language>en-us</language>

The lastBuildDate should be the date and time that the feed was last changed. Dates in RSS feeds should comply to RFC 822. In CFML the DateFormat mask would be ddd, dd mmm yyyy and the TimeFormat would be HH:mm:ss. Dates should be offset to GMT. The lastBuildDate tag is not required but is highly recommended.

Step 4: RSS Items

Next we enumerate over each RSS item, each item has a title, link, and description, publication date, and guid.

<item>
<title>Title of an item</title>
<link>http://example.com/item/123</link>
<guid>http://example.com/item/123</guid>
<pubDate>Mon, 12 Sep 2005 18:37:00 GMT</pubDate>
<description>[CDATA[ This is the description. ]]</description>
</item>
<!-- put more items here -->

Make sure you escape any characters that might cause your XML to invalidate, these characters include <, >, & - I like to enclose any content that may contain HTML inside a CDATA section.

Note: In CFML you can use the XmlFormat function to escape special characters in XML.

Step 5: Close Channel and RSS tags.

</channel>
</rss>

Step 6: Validate your feed

Validate your feed using FeedValidator.org (http://FeedValidator.org)

reginne44
10-28-2009, 07:35 AM
Hi There!
This is Reginne!
Im new in this site!
I hope I can have more friends here!
Ok! Thanks for that info!
Just keep on posting Guys and give some info or news about whats happening around.
Good Luck to all!
Its nice to have you Guys!
Thanks!...

avaxork09
12-12-2009, 11:33 PM
Hi Everyone,

I need help in creating a RSS feed specific to podcast alley, I created one for itunes but the bastards need a credit card to register so I can submit my podcast.

I just need to know what things I would require in the feed to make it compatible with podcast alley??

avaxork09
12-14-2009, 03:49 PM
Do you know how to show extra subscribe options when open RSS feed in web browser?

By default it shows "Subscribe to this feed" but i want to have also these:

"Add this feed to iGoogle" and "Subscribe to this feed in Google Reader"

I am wondering how to do it, any help?

thanks

braq
02-24-2010, 01:01 AM
Hello,
let me know... I would assume any rss reader (including the one you found) would ignore the directive ... but a simple web browser might handle it when viewing the rss directly. but it would need a FULL style sheet to show each of the different tags... very messy!