Java Tools

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  83 随笔 :: 0 文章 :: 16 评论 :: 0 Trackbacks
RSS

内容目录

RSS Introduction [RSS介绍]
An introduction to what RSS is and how it can be used.
介绍什么是RSS,它的应用。

RSS History [RSS历史]
How RSS started and how it has been developed and changed
RSS是怎么诞生的,它是怎样发展和变化的.

RSS Syntax [RSS语法]
A brief introduction how to make RSS.
制作RSS的简单介绍

RSS Channel [RSS频道]
How to make and what can be included in the <channel> element.
怎么完成<channel>元素里的内容

RSS Item [RSS内容]- How to make and what can be included in the <item> element.
怎样的<item>元素才算合理的

RSS Publishing [RSS 发布]- How to publish your RSS.
怎样发布的你的RSS

RSS Readers [RSS阅读器]- How to read other site's RSS.
怎样阅读其他网站的RSS


RSS介绍
翻译:Linyupark / 2006-04-24

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 命名空间

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的历史
翻译:Linyupark / 2006-04-24

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
    1999年7月 - RSS0.91 网景试图移入更多的标准格式并包含更多来自scriptingNews2.0b1的特性但是他们却删除了RDF头  
  • Jul. 1999 - UserLand uses RSS 0.91 and gets rid of scriptingNews
    1999年7月 - UserLand利用了没有scriptNews的RSS0.91
     
  • Netscape discontinues their RSS development
     网景中断了他们对RSS的开发
  • Jun. 2000 - Official RSS 0.91 specification release from UserLand
     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标准开发.


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语法
翻译:Linyupark / 2006-04-24

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文档使用了简单的自描述语法。

<?xml version="1.0" encoding="ISO-8859-1" ?>

<rss version="2.0">
<channel>

<title>W3Schools</title>
<link>http://www.w3schools.com</link>
<description>W3Schools Web Tutorials </description>
<item>
<title>RSS Tutorial</title>

<link>http://www.w3schools.com/rss</link>
<description>Check out the RSS tutorial
on W3Schools.com</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.
文档内的第一行为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版本的文档")

<rss version="2.0">

The next line describes the <channel> element of the document:
再下面的一行描述了文档的<channel>元素:

<channel>

The next three lines describe three child elements of the <channel> element (<title>, <link> and <description>):
接下来的三行描述了<channel>的三个子元素(<title>,<link>,<description>)

<title>W3Schools</title>
<link>http://www.w3schools.com</link>

<description>W3Schools Web Tutorials</description>

Then there is an <item> element. The <item> element contains the information you would like your RSS feed to show (<title>, <link> and <description>). You can add multiple <item> elements:
然后就是<item>元素,<item>元素包含了RSS展示的一些信息(<title>, <link> 和 <description>)你可以添加数个<item>元素:

<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>Check out the RSS tutorial
on W3Schools.com</description>
</item>

Finally, the two last lines close the <channel> and <rss> elements:
最后的两行关闭<channel> 和 <rss> 元素:

</channel>
</rss>

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


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十分相似:

<!-- This is a comment -->


RSS channel元素
翻译:Linyupark / 2006-04-24

The <channel> element is where you describe your RSS feed.
<channel>元素内是描述RSS feed的地方

With RSS 2.0 there are a lot of different options for the channel element.
对于channel元素来说RSS2.0有很多不同的选择(指内部可选择的元素有很多种)


The <channel> Element
<channel>元素

The RSS <channel> element is where items are displayed. It is like an RSS headline. Channel elements normally do not change very often.
RSS的<channel>元素是项目内容显示的地方。它就像RSS的标题。一般来讲它不会频繁的改动。

There are three required elements inside the <channel> element: <title>, <link>, and <description>.
有三个内部元素是必须有的:<title>, <link>, 和 <description>.

The <title> element should contain a short description of your site and your RSS feed:
<title>元素里应该包含你的站和你的RSS feed简短的说明:

<title>W3Schools News Update</title>

The <link> element should define the link to your site's main page:
<link>元素应该定义你网站主页的链界:

<link>http://www.w3schools.com</link>

The final required element is <description>. This element should describe your RSS feed.
最后必须有的元素就是 <description>,这个元素应该描述你的RSS feed.

<description>W3Schools Web Tutorials</description>


Optional Elements in <channel>
<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
频道所使用的RSS版本文档URL
<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
定义编辑站点人员的E-mail地址
<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 元素
翻译:Linyupark / 2006-04-24

The <item> element is where you link to and describe the update on your site.
<item>元素内是你网站连接和描述更新内容的地方。

With RSS 2.0 there are a lot of different options for the item element.
在RSS 2.0 item元素里有很多不同的可选内容


The <item> Element
<item>元素

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.
<item>是显示RSS更新内容的地方。它像是文章的标题。当你的站点有更新时RSSfeed中的<item>元素就会被建立起来。

There are several optional <item> elements, but either the <title> or the <description> are required.
<item>元素里有几个可选的元素,但<title> 或是<description>是必须有的。

A RSS <item> should include the <title>, <link> and <description> elements.
一个RSS的<item>应该包括 <title>, <link> 和 <description>元素

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.
再下面的一行就是RSS feed的描述部分,这应该是描述你的RSS feed项目的。

<description>W3Schools RSS Tutorial</description>


Optional Elements in <item>
可选的<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.
针对项目的评论页URL
<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.
转载地址(源地址)

RSS发布
翻译:Linyupark / 2006-04-24

Having a RSS feed is no good unless other people can see it.
光有RSS feed还是不够的,应该让别人能看到它


Publish Your RSS Feed
发布你的RSS feed

Publishing and getting people to notice your RSS feed is as important as making one.
发布并让人们注意到的你RSS就和你制作它一样重要

First, put your rss.xml file on the internet. You can place it on the same server as your site.
首先,将你的RSS.xml文件放到你的站点服务器上。

Next, let people know you have a RSS feed. Register your feed with an aggregator.
然后,让人们知道你有一个RSSfeed.到相关的目录站上注册你的RSS(下面是一些国外知名的RSS发布站)

  • Syndic8: The largest RSS directory. Syndicate has over 300,000 feeds listed. Register your feed here.
  • Daypop: A large news oriented RSS aggregator. Over 50,000 news oriented feeds. Register your feed here.
  • Newsisfree: A news oriented RSS aggregator. Over 18,000 feeds. Register your feed here.

Then, place this RSS Logo and this XML Logo with URL's to a page that explains briefly how other people can view your RSS feed.
接着, 将这两个含有连接到你RSS地址的图片放到你站点的页面上,人们就可以看到你的RSS feed了


Can I Manage my RSS Feed Myself?
我可以自行管理RSS feed吗?

The best way to be sure your RSS feed includes the things you want, and works the way you want, is to manage it yourself. But this can be very time consuming, especially for pages with a lot of updates.
如你想让RSS里包括一些你想要的东西或是想按你的想法来做,最好的办法就是你自己来管理它,但是这将是非常烦琐的,因为很多页有不同的东西要更新。

Your other alternative is to use a third party automated RSS.
还有种选择就是使用第三方的RSS自动生成器


Automated RSS
RSS自动生成

If you don't want to update your RSS feed yourself, there are tools and services you can use to automate it.
如果你不想自己来更新RSS,这有些工具可以为你服务。
===== 以下是几个工具的官方地址=====

One such service is MyRSSCreator (featured in "RSS for dummies"), who can offer an automated, reliable RSS service in just 10 minutes.

There are also free services such as FeedFire, who offers free creation and distribution of RSS feeds.

For users who just need an easy RSS feed for their personal website, some of the most popular blog (Web Log) managers (like Blogger and Radio) offers built in automated RSS services.


Validate
校验

You can validate your RSS feed here[校验地址]. This validator supports all RSS versions.


 

RSS阅读器
翻译:Linyupark / 2006-04-24

A RSS reader gathers your news for you.
一个RSS阅读器可以为你收集新闻

RSS readers are available for many different devices and OS.
RSS阅读器可以在很多不同的设备和操作系统上运作


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:

  • NewsGator Online - An free online based RSS aggregator. NewsGator Online also includes synchronization with Outlook Edition, viewing content on TV with Media Center Edition, as well as the publication of blogs and headlines.
     
  • RssReader - A free Windows based RSS aggregator. RssReader supports RSS versions 0.9x, 1.0 and 2.0 as well as Atom 0.1, 0.2 and 0.3.
     
  • FeedDemon - A great Windows based RSS aggregator. This is very easy to use and has a very orderly interface. But this is not freeware.
     
  • blogbot - A RSS aggregator plugin for your Outlook or Internet Explorer. The lite version for Internet Explorer is free.

There are a lot of other RSS readers out there. http://www.ourpla.net/cgi-bin/pikie.cgi?RssReaders has a big list of RSS readers, you can even add your own readers to this page or comment on the existing ones.



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=704849

posted on 2007-07-14 00:37 和田雨 阅读(533) 评论(0)  编辑  收藏 所属分类: XML

只有注册用户登录后才能发表评论。


网站导航: