RSS
  1. RSS introduction
  2. RSS structure
  3. RSS tags
  4. RSS channels
  5. RSS items
  6. RSS publish
  7. RSS read
  8. RSS find
  9. RSS tools
  10. RSS Summary

RSS <channel> tag

The <channel> tag is used to describe an RSS feed. Within the <channel> tag, the <item> tag is used for each item in the RSS feed. Both these tags have three required child tags:

We discussed the core aspects of the <channel> tag in the RSS structure page, but there is much more you can do with it. Besides it's required elements, the <channel> tag has a bunch of optional elements.

category

Specifies a category for your RSS feed. This makes it possible for RSS feed readers to group your website in its appropriate category.

Example:
<category>World News</category>

generator

Specifies the program used to create your RSS feed. Should be used if the RSS feed is created using an automatic RSS feed creator like myRSScreator

Example:
<generator>myRSScreator</generator>

language

Specifies the language your RSS feed is written in. This makes it possible for RSS feed readers to group your website in a category based on language.

Example:
<language>en-us</language>

NOTE: The language should be specified using one of the ISO language codes. In the above we specify US English.

lastBuildDate

Specifies the most recent time the content of your RSS feed was modified.

Example:
<lastBuildDate>Fri, 2 Feb 1900</lastBuildDate>

ttl

ttl stands for Time To Live. This element specifies how many minutes your RSS feed can stay cached before it is refreshed.

Example:
<ttl>120</ttl>
A complete RSS file with optional and required elements for the <channel> tag:
<?xml version="1.0" encoding="ISO-8859-1" ?> <rss version="2.0"> <channel> <title>Landofcode.com web tutorials updates</title> <link>http://www.landofcode.com</link> <description>Web development tutorials</description> <language>en-us</language> <category>Web Development</category> <ttl>60</ttl> <lastBuildDate>Wednesday, 2 Apr 2000</lastBuildDate> <generator>notepad++</category> <item> <title>Online code editor</title> <link>http://www.landofcode.com/online-code-editor.php</link> <description>New functionality added to the code editor. Check it out!</description> </item> <item> <title>Errors fixed</title> <link>http://www.landofcode.com</link> <description>Fixed a bunch of errors. Site runs much better now</description> </item> <item> <!-- add three more HTML tutorials next week--> <title>HTML tutorials</title> <link>http://www.landofcode.com/html-tutorials/</link> <description>Five new tutorials added to the HTML tutorials section.</description> </item> </channel> </rss>

For a full list of channel elements (optional and required) check out our RSS channel elements reference page.

© Copyright 2013-2014 Landofcode.com
Terms of use | Privacy policy | Copyright information