现在的位置: 首页 > 综合 > 正文

RSS Introduction

2014年09月05日 ⁄ 综合 ⁄ 共 6639字 ⁄ 字号 评论关闭

RSS Icon:

image

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

Benefits of RSS

Easy News

Choose your news
With RSS you can choose to view the news you want, the news that interest you and are relevant to your work.

Remove Spam

Remove unwanted information
With RSS you can (finally) separate wanted information from unwanted information (spam)!

More Traffic

Increase your site traffic
With RSS you can create your own news channel, and publish it to the Internet!

Is There an RSS Web Standard?

There is no official standard for RSS.

  • About 50 % of all RSS feeds use RSS 0.91
  • About 25 % use RSS 1.0
  • The last 25 % is split between RSS 0.9x versions and RSS 2.0

How RSS Works

RSS is used to share content between websites.

With RSS, you register your content with companies called aggregators.

So, to be a part of it: First, create an RSS document and save it with an .xml extension. Then, upload the file to your website. Next, register with an RSS aggregator. Each day the aggregator searches the registered websites for RSS documents, verifies the link, and displays information about the feed so clients can link to documents that interests them.

Tip: Read our RSS Publishing chapter to view free RSS aggregation services.

RSS Example

RSS documents use a self-describing and simple syntax.

Here is a simple RSS document:

<?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>

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.

The <category> Element

The <category> child element is used to specify a category for your feed.

The <category> element makes it possible for RSS aggregators to group sites based on category.

The category for the RSS document above could be:

<category>Web development</category>

The <copyright> Element

The <copyright> child element notifies about copyrighted material.

The copyright for the RSS document above could be:

<copyright>2006 Refsnes Data as. All rights reserved.</copyright>

The <image> Element

The <image> child element allows an image to be displayed when aggregators present a feed.

The <image> element has three required child elements:

  • <url> - Defines the URL to the image
  • <title> - Defines the text to display if the image could not be shown
  • <link> - Defines the hyperlink to the website that offers the channel

The image for the RSS document above could be:

<image>
  <url>http://www.w3schools.com/images/logo.gif</url>
  <title>W3Schools.com</title>
  <link>http://www.w3schools.com</link>
</image>

The <language> Element

The <language> child element is used to specify the language used to write your document.

The <language> element makes it possible for RSS aggregators to group sites based on language.

The language for the RSS document above could be:

<language>en-us</language>

Each <item> element defines an article or "story" in an RSS feed.

The <author> Element

The <enclosure> Element

The <enclosure> child element allows a media-file to be included with an item.

The <enclosure> element has three required attributes:

  • url - Defines the URL to the media file
  • length - Defines the length (in bytes) of the media file
  • type - Defines the type of media file

Get Your RSS Feed Up On The Web

Now it's time to get your RSS file up on the web. Here are the steps:

1. Name your RSS file. Notice that the file must have an .xml extension.

2. Validate your RSS file (a good validator can be found at http://www.feedvalidator.org).

3. Upload the RSS file to your web directory on your web server.

4. Copy the little orange RSS Logo or XML Logo button to your web directory.

5. Put the little orange "RSS" or "XML" button on the page where you will offer RSS to the world (e.g. on your home page). Then add a link to the button that links to the RSS file. The code will look something like this:
<a href="www.w3schools.com/rss/myfirstrss.xml">
<img src="www.w3schools.com/rss/rss.gif" width="36" height="14">
</a>.

6. Submit your RSS feed to the RSS Feed Directories (you can Google or Yahoo for "RSS Feed Directories"). Note! The URL to your feed is not your home page, it is the URL to your feed, like "http://www.w3schools.com/rss/myfirstrss.xml". Here are some free RSS aggregation services:

7. Register your feed with the major search engines:

8. Update your feed - Now you have registered your RSS feed with Google, Yahoo, and MSN. Now you must make sure that you update your content frequently and that your RSS feed is constantly available.

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:

An RSS Reader is used to read RSS Feeds!

RSS readers are available for many different devices and OS.


RSS Readers

There are a lot of different RSS readers. Some work as web services, and some are limited to windows (or Mac, PDA or UNIX). Here are a few I have tried and liked:

  • RssReader - A free Windows-based RSS reader. Supports RSS versions 0.9x, 1.0 and 2.0 and Atom 0.1, 0.2 and 0.3.
  • FeedDemon - A Windows-based RSS reader. Very easy to use and has a very orderly interface.
  • blogbot - An RSS reader plug-in for Outlook or Internet Explorer. The light-version for Internet Explorer is free.

Tip: Most browsers have a built-in RSS Reader. If you go to a web site that offers RSS feeds, you will see an RSS icon in the address bar, or toolbar. Click on the icon to view a list of the different feeds. Choose the feed you want to read.

抱歉!评论已关闭.