Professional Documents
Culture Documents
RSS is a method that uses XML to distribute web content on one web site, to many other web sites.
RSS allows fast browsing for news and updates.
What is RSS?
RSS stands for Really Simple Syndication
RSS allows you to syndicate your site content
RSS defines an easy way to share and view headlines and content
RSS files can be automatically updated
RSS allows personalized views for different sites
RSS is written in XML
The first line in the document - the XML declaration - defines the XML version and the character encoding
used in the document. In this case the document conforms to the 1.0 specification of XML and uses the ISO-
8859-1 (Latin-1/West European) character set.
The next line is the RSS declaration which identifies that this is an RSS document (in this case, RSS version
2.0).
The next line contains the <channel> element. This element is used to describe the RSS feed.
The <channel> element has three required child elements:
<title> - Defines the title of the channel (e.g. W3Schools Home Page)
<link> - Defines the hyperlink to the channel (e.g. http://www.w3schools.com)
<description> - Describes the channel (e.g. Free web building tutorials)
Each <channel> element can have one or more <item> elements.
Each <item> element defines an article or "story" in the RSS feed.
The <item> element has three required child elements:
<title> - Defines the title of the item (e.g. RSS Tutorial)
<link> - Defines the hyperlink to the item (e.g. http://www.w3schools.com/rss)
<description> - Describes the item (e.g. New RSS tutorial on W3Schools)
Finally, the two last lines close the <channel> and <rss> elements.
Comments in RSS
The syntax for writing comments in RSS is similar to that of HTML:
RSS comment -->
RSS is written in XML
Because RSS is XML, keep in mind that:
All elements must have a closing tag
Elements are case sensitive
Elements must be properly nested
Attribute values must always be quoted
As mentioned before, the <channel> element describes the RSS feed, and has three required child elements:
<title> - Defines the title of the channel (e.g. W3Schools Home Page)
<link> - Defines the hyperlink to the channel (e.g. http://www.w3schools.com)
<description> - Describes the channel (e.g. Free web building tutorials)
The <channel> element usually contains one or more <item> elements. Each <item> element defines an
article or "story" in the RSS feed.
Furthermore, there are several optional child elements of <channel>. We will explain the most important ones
below.
Element Description
<category> Optional. Defines one or more categories for the feed
<cloud> Optional. Register processes to be notified immediately of updates of the feed
<copyright> Optional. Notifies about copyrighted material
<description> Required. Describes the channel
<docs> Optional. Specifies an URL to the documentation of the format used in the feed
<generator> Optional. Specifies the program used to generate the feed
<image> Optional. Allows an image to be displayed when aggregators present a feed
<language> Optional. Specifies the language the feed is written in
<lastBuildDate> Optional. Defines the last-modified date of the content of the feed
<link> Required. Defines the hyperlink to the channel
<managingEditor> Optional. Defines the e-mail address to the editor of the content of the feed
<pubDate> Optional. Defines the last publication date for the content of the feed
<rating> Optional. The PICS rating of the feed
<skipDays> Optional. Specifies the days where aggregators should skip updating the feed
<skipHours> Optional. Specifies the hours where aggregators should skip updating the feed
<textInput> Optional. Specifies a text input field that should be displayed with the feed
<title> Required. Defines the title of the channel
<ttl> Optional. Specifies the number of minutes the feed can stay cached before refreshing it
from the source
<webMaster> Optional. Defines the e-mail address to the webmaster of the feed
Attributes
Tag Description
domain Optional. A string or URL that identifies categorization taxonomy.
Example:
<category domain="syndic8">IT</category>
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
<category>IT/Internet/Web development</category>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>
<category>News</category>
<category>Tutorial</category>
</item>
</channel>
</rss>
Out Put
W3Schools Home Page
Free web building tutorials
Category: IT/Internet/Web development
RSS Version: 2.0
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
<cloud domain="www.w3schools.com" port="80" path="/RPC"
registerProcedure="NotifyMe" protocol="xml-rpc" />
<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>
</item>
</channel>
</rss>
Out Put:
W3Schools Home Page
Free web building tutorials
Category: IT/Internet/Web development
RSS Version: 2.0
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
<copyright>2006 Refsnes Data as. All rights reserved.</copyright>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>
</item>
</channel>
</rss>
Output:
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
</channel>
</rss>
Output:
Example
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
<generator>Notepad</generator>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>
</item>
</channel>
</rss>
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Created with: Notepad
Tag Description
<description> Optional. Specifies the text in the HTML title attribute of the link around the image
<height> Optional. Defines the height of the image. Default is 31. Maximum value is 400
<link> Required. Defines the hyperlink to the website that offers the channel
<title> Required. Defines the text to display if the image could not be shown
<url> Required. Specifies the URL to the image
<width> Optional. Defines the width of the image. Default is 88. Maximum value is 144
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
<image>
<url>http://www.w3schools.com/images/logo.gif</url>
<title>W3Schools.com</title>
<link>http://www.w3schools.com</link>
</image>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>
</item>
</channel>
</rss>
Output:
Example
Example
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Channel Updated: Thu, 27 Apr 2006
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
</channel>
</rss>
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
<managingEditor>editor@w3schools.com</managingEditor>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>
</item>
</channel>
</rss>
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Mail Editor: editor@w3schools.com
Example
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Feed Updated: Thu, 27 Apr 2006
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
<skipDays>Saturday</skipDays>
<skipDays>Sunday</skipDays>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>
</item>
</channel>
</rss>
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Skip Days: Saturday/Sunday
Example
Output:
Tag Description
<description> Required. Defines a description of the text input area
<name> Required. Defines the name of the text object in the text input area
<link> Required. Defines the URL of the CGI script that processes the text
input
Example
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Top of Form
Bottom of Form
When u will enter any word a Google search bar will display information related to the word.
Example
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
<ttl>60</ttl>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>
</item>
</channel>
</rss>
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Time to live: 60
Example
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Mail Webmaster: webmaster@w3schools.com
As mentioned before, each <item> element defines an article or "story" in the RSS feed.
The <item> element has three required child elements:
<title> - Defines the title of the item (e.g. RSS Tutorial)
<link> - Defines the hyperlink to the item (e.g. http://www.w3schools.com/rss)
<description> - Describes the item (e.g. New RSS tutorial on W3Schools)
Furthermore, there are several optional child elements of <item>. We will explain the most important ones
below.
<author>hege@refsnesdata.no</author>
<comments>http://www.w3schools.com/comments</comments>
<enclosure url="http://www.w3schools.com/rss/rss.mp3"
length="5000" type="audio/mpeg" />
Element Description
<author> Optional. Specifies the e-mail address to the author of the item
<category> Optional. Defines one or more categories the item belongs to
<comments> Optional. Allows an item to link to comments about that item
<description> Required. Describes the item
<enclosure> Optional. Allows a media file to be included with the item
<guid> Optional. Defines a unique identifier for the item
<link> Required. Defines the hyperlink to the item
<pubDate> Optional. Defines the last-publication date for the item
<source> Optional. Specifies a third-party source for the item
<title> Required. Defines the title of the item
Example
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Attributes
Tag Description
domain Optional. A string or URL that identifies a categorization taxonomy.
Example:
<category domain="syndic8">IT</category>
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
<category>IT/Internet/Web development</category>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>
<category>News</category>
<category>Tutorial</category>
</item>
</channel>
</rss>
Output:
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>
<comments>http://www.w3schools.com/rss/comments.asp</comments>
</item>
</channel>
</rss>
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
RSS Tutorial: New RSS tutorial on W3Schools
Comments.
Example
Output:
Attribute Description
length Required. Defines the length (in bytes) of the media file
type Required. Defines the type of media file
url Required. Defines the URL to the media file
Example
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Attribute Description
isPermaLink Optional. If set to true, the reader may assume that it is a permalink to the item (a url
that points to the full item described by the <item> element). The default value is true.
If set to false, the guid may not be assumed to be a url
Example
Output:
Example
Output:
Example
Output:
Example
Output:
Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>
</item>
<item>
<title>XML Tutorial</title>
<link>http://www.w3schools.com/xml</link>
<description>New XML tutorial on W3Schools</description>
</item>
</channel>
</rss>
Output:
W3Schools Home Page
Free web building tutorials
RSS Version: 2.0
Automated RSS
If you don't want to update your RSS feed yourself, there are tools and services that can do it automatically
for you, such as:
MyRSSCreator - offers an automated, reliable RSS service in just 10 minutes
FeedFire - offers free creation and distribution of RSS feeds
For users who only need an RSS feed for their personal website, some of the most popular blog (Web Log)
managers that offer built-in RSS services are:
Blogger
Radio