|
RSS <channel> Element
The <channel> element is where you describe your RSS feed.
With RSS 2.0 there are a lot of different options for the channel element.
The <channel> Element
The RSS <channel> element is where items are displayed. It is like an RSS headline. Channel elements normally do not change very often.
There are three required elements inside the <channel> element: <title>, <link>, and <description>.
The <title> element should contain a short description of your site and your RSS feed:
<title>W3Schools News Update</title> |
The <link> element should define the link to your site's main page:
<link>http://www.w3schools.com</link> |
The final required element is <description>. This element should describe your RSS feed.
<description>W3Schools Web Tutorials</description> |
Optional Elements in <channel>
Element |
Description |
<category> |
Defines one or more categories the channel belongs to |
<cloud> |
Allows notification of updates. |
<copyright> |
Notifies about copyrighted material |
<docs> |
An URL to documentation on the RSS version the channel is using |
<generator> |
If the channel is created using an automatic generator, this is defined here |
<image> |
Inserts a picture to the channel. |
<language> |
Describes what language the channel uses. By using this tag it is possible for RSS aggregators to group sites based on language. |
<lastBuildDate> |
Defines the last date the channel was modified |
<managingEditor> |
Defines an e-mail address for the editor of the site |
<pubDate> |
Defines the last publication date for the channel |
<rating> |
Parental control rating of the page |
<skipDays> |
Defines days where it is unnecessary for RSS aggregators to update the feed |
<skipHours> |
Defines hours where it is unnecessary for RSS aggregators to update the feed |
<textInput> |
Creates a text input for the channel |
<ttl> |
(ttl = time to live) Defines how many minutes the channel can stay cached before refreshing |
<webMaster> |
Defines an e-mail address for the webmaster of the site |
RSS <item> Element
The <item> element is where you link to and describe the update on your site.
With RSS 2.0 there are a lot of different options for the item element.
The <item> Element
The RSS <item> is where updates are displayed. It is kind of like a headline for an article. <item> elements are created every time there is an update on your site that you would like displayed in your RSS feed.
There are several optional <item> elements, but either the <title> or the <description> are required.
A RSS <item> should include the <title>, <link> and <description> elements.
The first element is your news item's title. This should be a very short description of your site and your RSS feed:
<title>W3Schools New RSS Tutorial</title> |
The next element is the link to the part of your site the item is referring to:
<link>http://www.w3schools.com/rss</link> |
The next line is the RSS feed description. This should describe your RSS feed item.
<description>W3Schools RSS Tutorial</description> |
Optional Elements in <item>
Tag |
Description |
<author> |
Defines the author of the item. |
<category> |
Places the item in one or more of the channel categories. |
<comments> |
An URL to a comment's page for the item. |
<enclosure> |
Describes a media object related to the item |
<guid> |
GUID = Globally Unique Identifier. Defines a unique identifier to the item. |
<pubDate> |
The publication date for the item. |
<source> |
Is used to define a third party source. |
|