联系电话:020-28187900

RSS格式说明文档

发表时间:2012-08-20 阅读: 3958

RSS:一种最近十分流行的网络技术,是站点用来和其他站点之间共享内容的一种简易方式(又名聚合内容),通常被用于新闻和其他按顺序排列的网站,例如Blog。

RSS 的历史
1997 年 - Dave Winer 开发出 scriptingNews。RSS 由此诞生。
1999 年 - Netscape 开发出 RSS 0.90 (由 scriptingNews 支持的)。这是带有一个 RDF header 的简单的 XML。
1999 年- Dave Winer 在 UserLand 公司开发出 scriptingNews 2.0b1 (包含了 Netscape 的 RSS 0.90 的特定)。
1999 年 - Netscape 开发出 RSS 0.91。在此版本中,他们删除了那个 RDF header,但是包含了大多数来自 scriptingNews 2.0b1 的特性。
1999 年 - UserLand 摆脱了 scriptingNews,而仅仅使用 RSS 0.91。Netscape 停止了 RSS 的研发
2000 年 - UserLand 发布了正式的 0.91 规范
2000 年 - 一个由 Rael Dornfest 领导的团队在 O'Reilly 开发出 RSS 1.0。此格式使用了 RDF 和命名空间。此版本常被混淆为 0.91 的新版本,不过它是完全不依赖 RSS 0.91 的新格式。
2000 年 - Dave Winer 在 UserLand 公司开发出 RSS 0.92。
2002 年 - Dave Winer 在离开 Userland 之后开发出 RSS 2.0。
2003 年 - 正式的 RSS 2.0 规范发布。

以下是RSS 2.0的代码样例:

<!-- XML版本和字符集 -->
 <?xml version="1.0"?>
 <!-- RSS版本 -->
 <rss version="2.0">
 <!-- 以下为频道信息及新闻列表 -->
 <channel>
  <!-- 频道总体信息:开始 -->
  <!-- 频道标题 -->
  <title>唯众网络</title>
  <!-- 频道链接的总地址 -->
  <link>http://www.focuznet.com</link>
  <!-- 频道描述文字 -->
  <description>频道描述文字</description>
  <!-- 频道使用的语言(zh-cn表示简体中文) -->
  <language>zh-cn</language>
  <!-- 频道发布的时间 -->
  <pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
  <!-- 频道最后更新的时间-->
  <lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
  <docs>http://www.focuznet.com/rss</docs>
  <!-- 频道生成器 -->
  <generator>Weblog Editor 2.0</generator>
  <managingEditor>service@kingcms.com</managingEditor>
  <webMaster>service@kingcms.com</webMaster>
  <ttl>5</ttl>
  <!-- 频道总体信息:结束 -->
  <!-- 每条RSS新闻信息都包含在item节点中, -->
  <item>
  <!-- 新闻标题 -->
  <title>Star City</title>
  <!-- 新闻链接地址 -->
  <link>http://www.focuznet.com/news/t1321/</link>
  <!-- 新闻内容简要描述 -->
  <description>How do Americans get ready to work with Russians aboard the
  International Space Station? They take a crash course in culture, language
  and protocol at Russia's Star City.</description>
  <!-- 新闻发布时间 -->
  <pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>
  <!-- 新闻目录 -->
  <category>IT</category>
  <!-- 新闻作者 -->
  <author>bill</author>
  <guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid>
  </item>
  <item>
  <title>Space Exploration</title>
  <link>http://www.focuznet.com/news/t1321/</link>
  <description>Sky watchers in Europe, Asia, and parts of Alaska and Canada
  will experience a partial eclipse of the Sun on Saturday, May 31st.</description>
  Fri, 30 May 2003 11:06:42 GMT</pubDate>
  <guid>http://liftoff.msfc.nasa.gov/2003/05/30.html#item572</guid>
  </item>
  <item>
  <title>The Engine That Does More</title>
  <link>http://www.focuznet.com/news/t1321/</link>
  <description>Before man travels to Mars, NASA hopes to design new engines
  that will let us fly through the Solar System more quickly. The proposed
  VASIMR engine would do that.</description>
  Tue, 27 May 2003 08:37:32 GMT</pubDate>
  <guid>http://www.zhanghangfeng.cn/rss.xml</guid>
  </item>
  <item>
  <title>Astronauts' Dirty Laundry</title>
  <link>http://www.focuznet.com/news/t1321/</link>
  <description>Compared to earlier spacecraft, the International Space
  Station has many luxuries, but laundry facilities are not one of them.
  Instead, astronauts have other options.</description>
  Tue, 20 May 2003 08:56:02 GMT</pubDate>
  <guid>http://liftoff.msfc.nasa.gov/2003/05/20.html#item570</guid>
  </item>
  </channel>
 </rss>

元素channel的子元素列表RSS2.0

元素(Element) 描述(Description) 值域 重要性 举例(Example)
title 频道名称   必备 GoUpstate.com News Headlines
link 频道的URL   必备 http://www.focuznet.com
Description 频道的描述   必备 The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.
         
language 频道文章所用语言 可用netscape或w3c推荐的列表 可选 en-us
copyright 频道内容的版权说明   可选 Copyright 2002, Spartanburg Herald-Journal
managingEditor 责任编辑的email   可选 service@kingcms.com
webMaster 负责频道技术事务的网站管理员email   可选 service@kingcms.com
pubDate 频道内容发布日期,格式遵循RFC822格式(年份可为2们或4位)   可选 Sat, 07 Sep 2002 00:00:01 GMT
lastBuildDate 频道内容最后的修改日期   可选 Sat, 07 Sep 2002 09:42:31 GMT
category 指定频道所属的一个或几个类别   可选 Newspapers
generator 生成该频道的程序名   可选 MightyInHouse Content System v2.3
docs 指向该RSS文件所用格式说明的URL   可选 http://www.focuznet.com/rss
cloud 元素允许所有进程注册一个 cloud,用于获得频道的更新通知,并为 rss 种子实现一个轻量级的发布订阅协议。   可选
ttl 有效期,用以指明该频道可被缓存的最长时间 分钟为单位 可选 60
image 指定一个 GIF或JPEG或PNG图片,用以与频道一起显示   可选  
rating 这个频道的分级(主要指成人、限制、儿童等)   可选  
textInput 指定一个text输入框供用户输入,具体信息及功能未定。   可选  
skipHours 提示新闻聚合器,那些小时时段它可以跳过。   可选  
skipDays 提示新闻聚合器,那些天它可以跳过。   可选  

元素channel的子元素image的子元素列表RSS2.0

元素(Element) 描述(Description) 值域 重要性 举例(Example)
url 图片的url   必备  
title 图片的标题,用于http的alt属性  必备  
link 网站的url(实际中常以频道的url代替)   必备  
width 图片的宽度(象素为单位) 最大144,默认88 可选  
height 图片的高度(象素为单位) 最大400,默认31 可选  
description 用于link的title属性   可选  

元素channel的子元素cloud的子元素列表RSS2.0

元素(Element) 描述(Description) 值域 重要性 举例(Example)
domain Cloud程序所在机器的域名或IP地址     radio.xmlstoragesystem.com
port 访问clound程序所通过的端口    80
path 程序所在路径(不一定是真实路径)     /RPC2
registerProcedure 注册的可提供的服务或过程     xmlStorageSystem.rssPleaseNotify
protocol 协议 xml-rpc, soap , http-post 之一   xml-rpc

元素channel的子元素textInput的子元素列表RSS2.0

元素(Element) 描述(Description) 值域 重要性 举例(Example)
title Submit按钮的标签   必备  
description 解释text输入区   必备  
name Text area对象的名字   必备  
link 处理提交的请求的cgi程序   必备  

转载请注明出处:唯众网络


相关文章 【更多】

唯众网络