Simple Web Syndication with RSS 2.0 - Expanding your content listing
(Page 5 of 6 )
Now we’ll take a moment to list the additional sub-elements that relate to your channel items. The elements provide extra information specific to each piece of content offered.
Element | Description |
author | The email address of the content author. |
category | Adds a category for your item. |
comments | The URL of a page containing comments, such as blog or forum, relating to the item. |
enclosure | Describes the media attached to an item. |
guid | A unique string used to identify your item. |
pubDate | The publication date of the item |
source | The RSS channel that the item came from. |
Here I’ve added some additional elements to my channel item.
<item>
<title>A New Toolbar Can Boost Your Web Site Traffic
Dramatically</title>
<description>Dev Articles - Embedded Tools - 1/10/07</description>
<link>http://www.devarticles.com/c/a/Embedded-Tools/A-New-Toolbar-Can-
Boost-Your-Web-Site-Traffic-Dramatically</link>
<comments>http://www.devarticles.com/showblog/32759/A-New-Toolbar-Can-
Boost-Your-Web-Site-Traffic-Dramatically</comments>
<guid>http://www.devarticles.com/c/a/Embedded-Tools/A-New-Toolbar-Can-
Boost-Your-Web-Site-Traffic-Dramatically</guid>
<pubDate>Wed, 10 Jan 2007 00:13:01 GMT</pubDate>
</item>
I’ve used the comment sub-element to provide the URL for the article discussion blog. For the guid I just used the URL of the article since it’s always unique. Not setting item guids can prevent news readers from updating your listing properly. The pubDate has been set to show when the article went live on DevArticles.com.
Next: Making your feed available >>
More XML Articles
More By Nilpo/Developer Shed Staff Writer