RSS Tutorial
Technically, RSS is a Syndication Standard based on a type of XML file that resides on an internet server.
This tutorial gives a complete understanding on RSS.
What is RSS?
RSS is an open method for delivering regularly changing web content. Many news-related sites, weblogs and other online publishers syndicate their content as an RSS Feed to whoever wants it.
Any time you want to retrieve the latest headlines from your favorite sites, you can access the available RSS feeds via a desktop RSS reader. You can also make an RSS feed for your own site if your content changes frequently.
In brief:
What does RSS stand for? It depends on what version of RSS you are using.
What is RSS Feed?
How Does RSS Work?
This is how RSS works:
News Aggregators and Feed Readers:
The RSS feed readers and news aggregators are essentially the same thing and are piece of software. Both are used for viewing RSS feeds. News aggregators are designed specifically to view news related feeds but technically they can read any feeds.
Who can use RSS?
RSS started out with the intent of distributing news related headlines. The potential for RSS is significantly larger and can be used anywhere in the world.
Consider using RSS for the following:
Summary:
RSS is becoming popular every day. The reason is fairly simple. RSS is a free and easy way to promote a site and its content without the need to advertise or create complicated content sharing partnerships.
RSS Advantages
RSS is taking off so quickly because people are liking it. RSS is easy to use and it has advantages for a publisher as well as for a subscriber. Here we have listed out few advantages of RSS for subscribers as well as for publishers.
RSS Advantages for Subscribers:
RSS subscribers are the people who subscribe to read a published feed. Here are some of the advantages of RSS feeds for subscribers.
RSS Advantages for Publishers:
RSS publishers are the people who publish their content through RSS feed. I would suggest you to use RSS if you want to get your message out and easily and if you want people to see what you publish, and you want your news to bring people back to your site.
Here are some of the advantages of RSS if you publish on the Web:
RSS Version History
RSS was first invented by Netscape. They wanted to use an XML format to distribute news, stories and information. Netscape refined the version of RSS and then dropped it.
Later Userland Software started controlling RSS specifications and releasing newer RSS versions. They continued development of their own version of RSS and eventually UserLand released RSS v2.
RSS has been released in many different versions.
Which RSS Version Should be Used?
There is no consensus on using RSS feed version. Its up to you which version you want to use. I would personally suggest to use latest one which RSS2.0. This is simple enough to use and easy to learn.
RSS Feed Formats
RSS has been released in many different versions in last 10 years. Here we will give you detail about three most commonly used RSS version.
RSS v0.91 Feed Format:
RSS v1.0 Feed Format:
RSS v2.0/2.01 Feed Format:
RSS Reading Feeds
Many sites offer RSS feeds, which you can identify by a small yellow button that says either or . However, if you click one of these links, you will most likely get a page full of code in your browser.
To properly read the feed, you need an RSS reader. Here are the steps to get and use RSS Feed readers.
Step 1 - Get an RSS Feed Reader
There are a lot of different RSS readers available. Some work as web services, and some are limited to windows (or Mac, PDA or UNIX). Here are a few which you can try:
Step 2 - RSS Reader Installation
All the readers come alongwith installation instructions. So use provided script to install your RSS Reader on your computer.
When you first launch a standalone reader, most often you will see a toolbar and three window panes arranged much like the preview mode in Microsoft Outlook. The pane on the left side typically displays RSS feeds, or channels, to which you are subscribed. These can be organized into categories or folders.
The upper-right panel typically shows a list of articles within whichever channel is selected, and the article content is then displayed in the lower-right panel. To change channel groups, just click the drop-down box at the upper left beneath the menus. Sometimes a brief description will appear in the lower right; if so, click the link in the article to load the complete text.
Some standalone apps can be configured to send you e-mail every time there's a new article on a topic you're interested in.
Step 3 - Add Channels and Channel groups
To add a channel ie. RSS feed, go to the RSS page of any site using yellow button that says either or . Right-click or use CTRL+C to copy the URL from the address bar of your browser, which should show a page full of XML code.
Now go back to your newsreader, choose the category where you want the new subscription to live (Business, Entertainment, the New York Times), and select New or New Channel from the File menu. In most cases, the URL you copied should automatically be pasted into the URL field in the New Channel wizard. If not, you can cut and paste the URL yourself.
Step 4 - Customize RSS Reader:
When you accumulate lots of articles from your various feeds, it can become difficult to find specific information. Fortunately, newsreaders include useful tools for finding articles.
A Filter tool will show only articles that contain a keyword you specify. This may also be labeled Search. To use it, type a keyword directly into the Filter/Search bar.
Some readers include the ability to set a watch, an automatic search through all your incoming feeds for a specific keyword. For example, you could enter ICQ as a watch. If any article in any feed you subscribe to mentions ICQ, the article will be included in the Watch list.
You needs to check help section of your reader to find out more options to customize it according to your needs.
Step 5 - Cleaning unwanted feeds:
Eventually, you'll probably end up with more feeds than you want or can read regularly. In most readers, to delete a feed you're no longer interested in, you simply delete its title. Then your RSS reader won't seek out that information anymore, and you won't get any content from the publisher unless you go to its site or resubscribe to the feed.
RSS Feed Publishing
Now you are aware how to write a RSS Feed for your site. If you don't know how to prepare RSS feed file then please go through RSS Feed Formats.
Uploading RSS Feed:
Here are simple steps to put your RSS Feed on the web.
That's it, Now your RSS Feed is online and people can start using it. But there are ways to prompote your RSS Feed so that more number of people should use your RSS Feed.
Promote Your RSS Feed:
Keeping up-to-date Feed:
As we have explained earlier, RSS Feed makes sense for the site who are changing thier content very frequently. Like any news or bloggig sites.
So now you have gotten RSS feed buttons from Google, Yahoo, and MSN. Now you must make sure that you update your content frequently and that your RSS feed is constantly available.
RSS Validation & Validators
If you have created one RSS feed for your news group or web blog or for anyother purpose then it is your responsibility to ensure that your RSS feed file can be parsed by the XML parser of any subscribing site.
Many of RSS feed creation softwares validate XML at the time of feed creation but some don not do. Make a note that small errors can make your feed unreadable by the standard feed readers.
So I would suggest you before publishing your RSS feed make sure you have done all the required validations. You may wish to load your RSS feed file to your internet server and then enter the URL in one of the following validators to check the syntax.
NOTE: If you find that any of the above mentioned links is not available then please send me an email at webmaster@only4programmers.blogspot.in so that I can correct it, Thanks
What is Atom 1.0?
Atom is the name of an XML-based Web content and metadata syndication format, and an application-level protocol for publishing and editing Web resources belonging to periodically updated websites.
Atom is a relatively recent spec and is much more robust and feature-rich than RSS. For instance, where RSS requires descriptive fields such as title and link only in item breakdowns, Atom requires these things for both items and the full feed.
All Atom feeds must be well-formed XML documents, and are identified with theapplication/atom+xml media type.
Structure of an Atom 1.0 Feed:
A Feed consists of some metadata, followed by any number of entries. Here is a basic structure of an Atom 1.0 Feed
Atom 1.0 Feed Tags:
An Atom 1.0 Feed Document will be constructed of the following two elements:
There are some common construct which are required for the above two elements and they are explained in: Common Construct
<feed> Elements:Feed ID:
This identifies the feed using a universally unique and permanent URI. If you have a long-term, renewable lease on your Internet domain name, then you can feel free to use your website's address.
Syntax:
<id>http://only4programmers.blogspot.com/</id>
Required:
Required
Feed title:
This contains a human readable title for the feed. Often the same as the title of the associated website. This value should not be blank.
Syntax:
<title>Tutorials and Reference Manuals</title>
Required:
Required
Feed updatation Date:
Thsi indicates the last time the feed was modified in a significant way. All timestamps in Atom must conform to RFC 3339.
Syntax:
<updated>2007-07-13T18:30:02Z</updated>
Required:
Required
Feed Author:
This names one author of the feed. A feed may have multiple author elements. A feed must contain at least one author element unless all of the entry elements contain at least one author element.
An author element can have <name>, <email> and <uri> tags.
Syntax:<author> <name>Shanavas Rahiman</name> <email>shanavas@only4programmers.blogspot.com</email> <uri>http://only4programmers.blogspot.com/</uri> </author> Required:
Optional, but recommended
Feed link
This identifies a related Web page. The type of relation is defined by the rel attribute. A feed is limited to one alternate per type and hreflang. A feed should contain a link back to the feed itself.
Syntax:
<link>rel="self" href="/feed"</link>
Required:
Optional, but recommended
Feed Category:
This specifies a category that the feed belongs to. A feed may have multiple category elements.
Syntax:
<category>category term="sports"</category>
Required:
Optional
Feed Contributor:
This names one contributor to the feed. An feed may have multiple contributor elements.
Syntax:<contributor> <name>Mohtashim</name> </contributor> Required:
Optional
Feed generator:
This identifies the software used to generate the feed, for debugging and other purposes. Both the uri and version attributes are optional.
Syntax:<generator uri="/myblog.php" version="1.0"> Example Toolkit </generator> Required:
Optional
icon Tag:
This identifies a small image which provides iconic visual identification for the feed. Icons should be square.
Syntax:
<icon>/icon.jpg</icon>
Required:
Optional
logo Tag:
This identifies a larger image which provides visual identification for the feed. Images should be twice as wide as they are tall.
Syntax:
<logo>/logo.jpg</logo>
Required:
Optional
rights Tag:
This conveys information about rights, e.g. copyrights, held in and over the feed.
Syntax:
<rights> © 2007 only4programmers.blogspot.com </rights>
Required:
Optional
subtitle Tag:
This contains a human-readable description or subtitle for the feed.
Syntax:
<subtitle>A sub title </subtitle>
<entry> Elements:
An Atom Feed may contain one or more entry elements. Here's a list of the required and optional feed elements.
Entry ID:
This Identifies the entry using a universally unique and permanent URI. Suggestions on how to make a good id can be found here. Two entries in a feed can have the same value for id if they represent the same entry at different points in time.
Syntax:
<id>http://example.com/blog/1234</id>
Required:
Required
Entry Title:
This contains a human readable title for the entry. This value should not be blank.
Syntax:
<title>Atom 1.0 Tutorial</title>
Required:
Required
Entry updation date:
This indicates the last time the entry was modified in a significant way. This value need not change after a typo is fixed, only after a substantial modification. Generally, different entries in a feed will have different updated timestamps.
Syntax:
<updated>2007-07-13T18:30:02-05:00</updated>
Required:
Required
Entry Author:
This names one author of the entry. An entry may have multiple authors. An entry must contain at least one author element unless there is an author element in the enclosing feed, or there is an author element in the enclosed source element.
Syntax:<author> <name>Mohtashim</name> </author> Required:
Optional, but recommended
Entry Content:
This contains or links to the complete content of the entry. Content must be provided if there is no alternate link, and should be provided if there is no summary.
Syntax:
<content>complete story here</content>
Required:
Optional, but recommended
Entry link:
This identifies a related Web page. The type of relation is defined by the rel attribute. An entry is limited to one alternate per type and hreflang. An entry must contain an alternate link if there is no content element.
Syntax:
<link rel="alternate" href="/blog/1234"/>
Required:
Optional, but recommended
Entry summary:
This conveys a short summary, abstract, or excerpt of the entry. Summary should be provided if there either is no content provided for the entry, or that content is not inline.
Syntax:
<summary>Some text.</summary>
Required:
Optional, but recommended
Entry Category:
This specifies a category that the entry belongs to. A entry may have multiple category elements.
Syntax:
<category term="education"/>
Required:
Optional
Entry ontributor:
This names one contributor to the entry. An entry may have multiple contributor elements.
Syntax:<contributor> <name>Mohtashim</name> </contributor> Required:
Optional
Published Tag:
This contains the time of the initial creation or first availability of the entry.
Syntax:
<published>2007-07-13T09:17:51-08:00</published>
Required:
Optional
Entry source:
If an entry is copied from one feed into another feed, then the source feed's metadata (all child elements of feed other than the entry elements) should be preserved if the source feed contains any of the child elements author, contributor, rights, or category and those child elements are not present in the source entry.
Syntax:<source> <id>http://moretutorials.org/</id> <title>Tutorials and Reference Manuals</title> <updated>2007-07-13T18:30:02Z</updated> <rights>© 2007 More Tutorials.</rights> </source> Required:
Optional
Entry rights:
This conveys information about rights, e.g. copyrights, held in and over the entry.
Syntax:<rights type="html"> © 2007 only4programmers.blogspot.com </rights> Required:
Optional
Common Constructs:Category
<category> has one required attribute, term, and two optional attributes, scheme and label.
term identifies the category
scheme identifies the categorization scheme via a URI.
label provides a human-readable label for display.
Content
<content> either contains, or links to, the complete content of the entry.
In the most common case, the type attribute is either text, html, xhtml, in which case the content element is defined identically to other text constructs, which are described here.
Otherwise, if the src attribute is present, it represents the URI of where the content can be found. The type attribute, if present, is the media type of the content.
Otherwise, if the type attribute ends in +xml or /xml, then an xml document of this type is contained inline.
Otherwise, if the type attribute starts with text, then an escaped document of this type is contained inline.
Otherwise, a base64 encoded document of the indicated media type is contained inline.
Link
<link> is patterned after html's link element. It has one required attribute, href, and five optional attributes: rel, type, hreflang, title, and length.
href is the URI of the referenced resource (typically a Web page)
rel contains a single link relationship type. It can be a full URI or one of the following predefined values (default=alternate):
type indicates the media type of the resource.
hreflang indicates the language of the referenced resource.
title human readable information about the link, typically for display purposes.
length the length of the resource, in bytes.
Person
<author> and <contributor> describe a person, corporation, or similar entity. It has one required element, name, and two optional elements: uri, email.
<name> conveys a human-readable name for the person.
<uri> contains a home page for the person.
<email> contains an email address for the person.
Text
<title>, <summary>, <content>, and <rights> contain human-readable text, usually in small quantities. The type attribute determines how this information is encoded (default="text")
If type="text", then this element contains plain text with no entity escaped html.
<title type="text">AT&T bought by SBC!</title>
If type="html", then this element contains entity escaped html.
<title type="html"> AT&amp;T bought <b>by SBC</b>! </title>
If type="xhtml", then this element contains inline xhtml, wrapped in a div element.
<title type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> AT&T bought <b>by SBC</b>! </div> </title>
Check complete specification for atom 1.0 RFC4287.
Atom 1.0 Example Feed:
Here is the example feed files which shows how to write Feed using Atom 1.0
Atom1.0 File Extension:
A specific file-extension for an Atom 1.0 document is not required. But .xml is recommended.
RSS Further Extensions
RSS originated in 1999, and has strived to be a simple, easy to understand format, with relatively modest goals. After it became a popular format, developers wanted to extend it using modules defined in namespaces, as specified by the W3C.
RSS 2.0 adds that capability, following a simple rule. A RSS feed may contain elements not described on this page, only if those elements are defined in a namespace.
The elements defined in this tutorial are not themselves members of a namespace, so that RSS 2.0 can remain compatible with previous versions in the following sense -- a version 0.91 or 0.92 file is also a valid 2.0 file. If the elements of RSS 2.0 were in a namespace, this constraint would break, a version 0.9x file would not be a valid 2.0 file.
RSS is by no means a perfect format, but it is very popular and widely supported. Having a settled spec is something RSS has needed for a long time.
However, the RSS spec is, for all practical purposes, frozen at version 2.0.1. But you can anticipate possible 2.0.2 or 2.0.3 versions, etc. only for the purpose of clarifying the specification, not for adding new features to the format.
Subsequent work should happen in modules, using namespaces, and in completely new syndication formats, with new names.
|
No comments:
Post a Comment