RSS基础教程整理

WEB2.0我们面对太多有关BLOG、SNS的东西,这中间有个重要的概念是我们需要明白的,那就是RSS聚会,收集了一些入门的资料。本文翻译自W3C官方资料 Linyupark @ W3Schools

RSS介绍

RSS was designed to share data like headlines, links and short descriptions of these.
RSS 将数据分成像标题,连接和简单描述的形式。(浓缩过的信息)

RSS allows fast browsing for news and updates.
RSS能快速浏览新闻和更新内容。

——————————————————————————–

What You Should Already Know
哪些是你应该已经知道的
Before you continue you should have a basic understanding of the following:
在继续学习前你应该有下面这些知识点的基础:

HTML / XHTML
XML / XML 命名空间
If you want to study these subjects first, find the tutorials on our Home page.
如果你想先学下这些课程,到我们的首页去找吧~首页.

——————————————————————————–

What is RSS?
什么是RSS?
RSS stands for Really Simple Syndication
RSS就是 Really Simple Syndication (真正的简单聚合)
RSS allows you to syndicate your site content
RSS可以聚合你网站上的内容
RSS is a selected list of defined items on a site
RSS是一站点上被选中的内容清单
RSS defines an easy way to share and view headlines and content
RSS是一种更便捷的方法去查看标题和内容
RSS files can be automatically updated
RSS文件可以自动的更新
RSS allows personalized views for different sites
RSS允许更具人性化(个性化)的查看不同的站点
RSS is written in XML
RSS是用XML来书写的

——————————————————————————–

Why Use RSS?
为什么使用RSS?
RSS was designed to show selected data.
RSS 能展示被选择的数据(针对性)

Without RSS, users will have to check your site daily to check for new updates. This may be too time-consuming for many users. With an RSS feed (RSS is often called a News Feed or RSS Feed) they can check your site faster using an RSS aggregator (a site or program that gathers and sorts out several RSS feeds).
没有RSS的话,用户将必须每天到你的站上看看有没更新内容。这对于一些用户来说是很浪费时间的。通过一个RSS feed他们可以使用RSS阅读器更快的查看你的站是否有更新。

Since RSS data is small and fast-loading, it can easily be used with services like cell phones or PDA’s.
因为RSS数据很小而且加载速度很快,它可以容易的在手机或PDA服务上使用。

Web-rings with similar information can easily share data on their sites to make them better and more useful.
Wb-rings通过相似的信息可以方便的共享他们站点的信息。

——————————————————————————–

Who Should Use RSS?
哪些人应该使用RSS?
Webmasters who seldom update their sites do not need RSS.
站长如不是经常更新站带内信息的话可以不使用RSS

RSS can be useful for Web sites that are updated frequently, like:
RSS对于那些经常更新的站点来说是和有帮助的,像:

News sites – Lists news with title, date and descriptions
新闻站
Site changes – Lists changed pages or new pages
站点改动信息版块
Companies – Lists news and new products
公司站 – 新闻 和 新产品
Calendars – Lists upcoming events and important days
日历

——————————————————————————–

The Future of RSS
展望RSS
RSS is going to be everywhere.
RSS将遍及每个角落

Thousands of sites use RSS and more people understand its usefulness every day.
数千站使用着RSS并且每天有越来越多的人明白了它的有用之处。

By using RSS, information on the Web becomes easier to find and web developers can spread their information more easily to special interest groups.
有了RSS,在WEB上的信息变的容易找到并且WEB开发者能够容易的将信息传播给兴趣小组。

Hopefully, future RSS versions will include additional fields that will make it even easier to categorize and share.
未来的RSS版本可能包含额外的领域来使分类和分享信息来的更容易。

RSS历史

RSS has been released in many different versions.
RSS发布过一些不同的版本

——————————————————————————–

The History of RSS
RSS的历史
Here is the history of RSS according to Dave Winer (key developer of most of the RSS formats):
依据Dave Winer(RSS开发的关键人物)的描述,RSS有这样的历史:

Dec. 1997 – Dave Winer developed scriptingNews
1997年12月 Dave Winer 开发了新闻脚本

Mar. 1999 – RSS 0.90 was developed by Netscape, which supported the scriptingNews format. This was simply XML with a RDF Header
1999年三月 – RSS 0.90 由网景公司开发,支持格式化新闻脚本.

Jun. 1999 – scriptingNews 2.0b1 was developed by Dave Winer at UserLand. This included Netscape’s RSS 0.90 features
新闻脚本2.0b1于 1999年6月由Dave Winer开发,包含了网景RSS 0.90的特点

Jul. 1999 – RSS 0.91 was an attempt by Netscape to move towards a more standard format and included most features from scriptingNews 2.0b1 but they removed the RDF header

Jul. 1999 – UserLand uses RSS 0.91 and gets rid of scriptingNews

Netscape discontinues their RSS development

Jun. 2000 – Official RSS 0.91 specification release from UserLand

Aug. 2000 – RSS 1.0 developed by a group lead by Rael Dornfest at O’Reilly. This format uses RDF and namespaces. Because of its name it is often confused as being a new version of 0.91, but this is a completely new format with no ties to RSS 0.91

Dec. 2000 – RSS 0.92 developed by Dave Winer at UserLand and includes optional elements

Sep. 2002 – RSS 2.0 is designed by Dave Winer after leaving Userland

Jul. 2003 – RSS 2.0 specification released through Harvard under a Creative Commons license

——————————————————————————–

What Are The differences?
有什么区别?
Unlike the other RSS formats, RSS 1.0 was developed using the W3C RDF (Resource Description Framework) standard.
不像其他RSS的规格,RSS1.0使用W3C的DRF标准开发.

The idea behind RDF is to help create a Semantic Web. Read more about RDF and Semantic Web here. This does not matter too much for ordinary users, but is used towards the goal for a web standard that will make it easier for persons and applications to exchange data.

——————————————————————————–

What RSS Version Should I Use?
我该用哪个版本的RSS?
RSS 0.91 and RSS 2.0 are easiest to understand. RSS 1.0 is more complex to learn and takes more time and bandwidth to process.
RSS0.91和RSS2.0是最容易理解的版本。1.0学起来比较复杂热切需要花更多的带宽来运作。

Our tutorial is based on RSS 2.0.
我们的教程是基于RSS2.0的

——————————————————————————–

Is There an RSS Web Standard?
有RSS WEB标准吗?
There is no official standard for RSS. But about 50 % of all RSS feeds use the RSS 0.91 format. About 25 % use the RSS 1.0 format and the last 25 % is split between the other RSS 0.9x versions and RSS 2.0.
没有针对RSS的官方标准。但在所有的RSS feeds中大约有50% 使用RSS 0.91规格.25%使用RSS1.0规格并且至少有25%使用 RSS 0.9x 版本和 RSS 2.0之间。

RSS语法

The syntax rules of RSS 2.0 are very simple and very strict.
RSS2.0的语法规则非常简单并十分的严格。

This tutorial teaches how to create your own RSS feed and maintain it.
这个教程会教你如何建立你自己的RSS feed并维护它。

——————————————————————————–

An Example RSS document
一个RSS文档的例子
RSS documents use a self-describing and simple syntax.
RSS文档使用了简单的自描述语法。

[coolcode lang=”xml”]

W3Schools http://www.w3schools.com W3Schools Web Tutorials
RSS Tutorial

http://www.w3schools.com/rss Check out the RSS tutorial
on W3Schools.com




[/coolcode]
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.
文档内的第一行为XML声明-定义了XML的版本和文档使用的字符编码。这个例子里文档使用的是XML1.0版本,编码为 ISO-8859-1.

The next line describes the RSS element of the document (like it was saying: “this is an RSS document – version 2.0”):
下面的一行描述RSS文档元素(这个就像在说:”这是一份RSS2.0版本的文档”)

[coolcode]
The next line describes the element of the document:
再下面的一行描述了文档的元素:


The next three lines describe three child elements of the element (, <link> and <description>):<br /> 接下来的三行描述了<channel>的三个子元素(<title>,<link>,<description>)</p> <p><title>W3Schools http://www.w3schools.com W3Schools Web Tutorials
Then there is an element. The element contains the information you would like your RSS feed to show (, <link> and <description>). You can add multiple <item> elements:<br /> 然后就是<item>元素,<item>元素包含了RSS展示的一些信息(<title>, <link> 和 <description>)你可以添加数个<item>元素:</p> <p><item><br /> <title>RSS Tutorial http://www.w3schools.com/rss Check out the RSS tutorial
on W3Schools.com


Finally, the two last lines close the and elements:
最后的两行关闭 元素:



Did you understand that this was an RSS feed from W3Schools? Don’t you agree that RSS is pretty self-descriptive?
你明白这是个来自W3S的RSSfeed了不?难道你不认为这是个很好的RSS自我描述?
[/coolcode]

——————————————————————————–

RSS is an XML Dialect
RSS 是一种XML的方言
Because RSS is XML, there are a couple of things you must remember.
因为RSS是XML,有一些事你必须了解

All XML elements must have a closing tag
所有XML元素必须有关闭标签
XML tags are case sensitive
XML标签区分大小写
All XML elements must be properly nested
所有XML元素必须合理嵌套
Attribute values must always be quoted
属性值必须在引号内

——————————————————————————–

Comments in RSS
RSS注释
The syntax for writing comments in RSS is similar to that of HTML:
书写RSS注释的语法和HTML十分相似:

[coolcode][/coolcode]

还有一些和RSS Channel、RSS Item、发布、阅读器相关的资料不在此处说明。

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image