📅  最后修改于: 2023-12-03 15:19:51.566000             🧑  作者: Mango
RSS(Rich Site Summary 或 Really Simple Syndication)是一种用于在线发布和订阅更新内容的标准格式。使用RSS可以将更新内容通过RSS阅读器传输到订阅者的设备上,并能够实时更新内容。
最早的RSS版本是 RSS 0.90,由Netscape公司于1999年创建。此版本由RDF格式组成,它本身是一种简单的、类XML的元数据语言,可用于描述万维网资源。
<rss version="0.90">
<channel>
<title>Liftoff News</title>
<link>http://liftoff.msfc.nasa.gov/</link>
<description>Liftoff to Space Exploration.</description>
<language>en-us</language>
<pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
<lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>Weblog Editor 2.0</generator>
<managingEditor>editor@example.com</managingEditor>
<webMaster>webmaster@example.com</webMaster>
<item>
<title>Star City</title>
<link>
http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp
</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>
<guid>
http://liftoff.msfc.nasa.gov/2003/06/03.html#item573
</guid>
</item>
</channel>
</rss>
RSS 0.91 于2000年发布,是对0.90版本的一次小改进,主要添加了“cloud”元素和“category”元素。该版本没有使用XML命名空间。
<rss version="0.91">
<channel>
<title>Liftoff News</title>
<link>http://liftoff.msfc.nasa.gov/</link>
<description>Liftoff to Space Exploration.</description>
<lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<cloud domain='rpc.sys.com' port='80' path='/RPC2' registerProcedure='pingMe' protocol='soap'/>
<category domain="http://sys.com/category">sometopic</category>
<item>
<title>Star City</title>
<link>
http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp
</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>
</item>
</channel>
</rss>
在2001年,RSS 0.92发布,主要是通过添加XML命名空间清理了元素的混乱。该版本增加了“image”元素。
<rss version="0.92" xmlns:image="http://imagens.com/">
<channel>
<title>Liftoff News</title>
<link>http://liftoff.msfc.nasa.gov/</link>
<description>Liftoff to Space Exploration.</description>
<language>en-us</language>
<image>
<url>http://liftoff.msfc.nasa.gov/gallery/images/</url>
<title>Liftoff News</title>
<link>http://liftoff.msfc.nasa.gov/</link>
</image>
<item>
<title>Star City</title>
<link>
http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp
</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>
</item>
</channel>
</rss>
RSS 1.0于2000年发布,是RDF Site Summary标准的扩展。 它基于RDF,并使用XML命名空间。该版本使用“rdf:about”属性作为项目标识符。
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/">
<channel rdf:about="http://liftoff.msfc.nasa.gov/">
<title>Liftoff News</title>
<link>http://liftoff.msfc.nasa.gov/home.htm</link>
<description>Liftoff to Space Exploration.</description>
<items>
<rdf:Seq>
<rdf:li rdf:resource="http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp"/>
</rdf:Seq>
</items>
</channel>
<item rdf:about="http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp">
<title>Star City</title>
<link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp</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>
</item>
</rdf:RDF>
于2002年发布的RSS 2.0是目前最常用的版本。它仍然使用XML命名空间,并添加了“enclosure”元素和“GUID”元素。
<rss version="2.0">
<channel>
<title>Liftoff News</title>
<link>http://liftoff.msfc.nasa.gov/</link>
<description>Liftoff to Space Exploration.</description>
<language>en-us</language>
<pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
<lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>Weblog Editor 2.0</generator>
<managingEditor>editor@example.com</managingEditor>
<webMaster>webmaster@example.com</webMaster>
<item>
<title>Star City</title>
<link>
http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp
</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>
<guid isPermaLink="false">http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid>
<enclosure url="http://liftoff.msfc.nasa.gov/2003/06/03.html#item573"
length="123456"
type="audio/mpeg" />
</item>
</channel>
</rss>
总体来说,RSS在不断地演变和改进,它在内容的领域内已经成为了一个非常重要的标准。