RSS (Really Simple Syndication) news feeds make it easy for you to get news and content updates from your favorite websites, all in one place. When you subscribe to a feed, new articles and updates are automatically sent to a web service or software known as a feed reader or aggregator. Read about how RSS feeds work…
If you run a blog and use a blogging tool, probably the tool generates an RSS feed for you… so, you don’t need to worry about how to write RSS documents.
RSS feed is an XML based file. There are different variations of the RSS format. I recommend RSS 2.0 since it is the most popular and has a lot of features. If you understand how HTML works, you can learn how to build your own RSS 2.0 feed easily just make sure you follow the XML 1.0 specifications published by the W3C (World Wide Web Consortium).
Check the functionality of this file at:
http://pacificdesigners.com/rss/rss.xml
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=”ISO-8859-1″ ?> <rss version=”2.0″ xmlns:atom=”http://www.w3.org/2005/Atom”> |
The first line specifies the document as XML and the document encoding that will be used.
The second line states you are using RSS and which version of RSS you are using. I recommend you copy this into your file as it is.
Step 2: Channel and Feed information:
| <channel> <title>RSS Test - How to build your own RSS 2.0 feed </title> <link>http://www.pacificdesigners.com/rss/rss.xml</link> <description>RSS TEST - This is the description of the RSS Feed</description> <docs>http://www.pacificdesigners.com/rss/rss.xml</docs> <language>en-us</language> <ttl>60</ttl> <atom:link href=”http://www.pacificdesigners.com/rss/rss.xml” mce_href=”http://www.pacificdesigners.com/rss/rss.xml” rel=”self” type=”application/rss+xml” /><image> <url>http://www.pacificdesigners.com/rss/rss.gif</url> <title>RSS Test - How to build your own RSS 2.0 feed</title> <link>http://www.pacificdesigners.com/rss/rss.xml</link> <width>100</width> <height>100</height> </image> |
We open the channel tag, which contains information and content about the feed.
Title, Description and Link are required channel elements.
Title: The name of the channel.
Description: Sentence describing the channel.
Link: URL to the HTML website corresponding to the channel.
We have to insert a atom:link to the feed in the channel section. According to the RSS Advisory Board’s Best Practices Profile, identifying a feed’s URL within the feed makes it more portable, self-contained, and easier to cache.
There are some optional elements used in this file as:
language: The language the channel is written in. This element allows aggregators to group same language sites on a single page.
docs: URL that points to the documentation for the format used in the RSS file.
image: Image that can be displayed with the channel (GIF, JPG or PNG)
ttl: Time to live. It’s a number of minutes that indicates how long a channel can be cached before refreshing from the source.
Step 3: RSS Items
| <item> <title>How RSS feeds work</title> <link>http://pacificdesigners.com/blog/?p=20</link> <guid>http://pacificdesigners.com/blog/?p=20</guid> <description><![CDATA[Now, you have your blog running with your smiling picture on it. Now what? ]]></description> <pubDate>Sat, 02 Feb 2008 19:22:00 PST</pubDate> </item> <item> <title>Spread Your Blog</title> <link>http://pacificdesigners.com/blog/?p=24</link> <guid>http://pacificdesigners.com/blog/?p=24</guid> <description><![CDATA[RSS = Really Simple Syndication = Rich Site Summary ]]></description> <pubDate>Wed, 06 Feb 2008 06:18:00 PST</pubDate> </item> <!– you can add more items here –> |
Next we enumerate over each RSS item. A channel may contain any number of <item>. All elements of an item are optional, but at least one of title or description must be present.
Some optional elements used in this file are:
guid: Guid stands for globally unique identifier. It’s a string that uniquely identifies the item.
pubDate: Its value is a date, indicating when the item was published.
Step 4: Close Channel and RSS tags.
| </channel> </rss> |
Finally, validate your feed at: FeedValidator.org
To make your RSS feed look pretty, you can add a stylesheet to the feed.
There are two types of stylesheets you could add. first, using XML and the second one using CSS.
I will explain about it in my next blog….
…Victoria…

![Validate my RSS feed [Valid RSS]](http://pacificdesigners.com/blog/wp-content/uploads/2008/02/valid-rss.png)

Welcome to my new blog. I intend to write about the art of making web sites, share my knowledge and experiences in web design with you and maybe just to vent!