rss格式规范及示例解释

知识技术 2022-04-18 01:48 878
转载请务必注明: 来源:《建站管家》https://www.df81.com/news/278.html

Rss标准格式

1.RSS:简单来讲,实际就是一个大家定义好的xml格式结构。

2.Rss阅读器:把xml里的数据解析后,以html页面展示。

3.rss定义的xml格式。

以下是RSS 2.0的代码样例及解释:

<!-- XML版本和字符集 -->
 <?xml version="1.0"?>
 <!-- RSS版本 -->
 <rss version="2.0">
 <!-- 以下为频道信息及新闻列表 -->
 <channel>
  <!-- 频道总体信息:开始 -->
  <!-- 频道标题 -->
  <title>Lift Off News</title>
  <!-- 频道链接的总地址 -->
  <link>http://liftoff.msfc.nasa.gov/</link>
  <!-- 频道描述文字 -->
  <description>Liftoff to Space Exploration.</description>
  <!-- 频道使用的语言(zh-cn表示简体中文) -->
  <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>
  <ttl>5</ttl>
  <!-- 频道总体信息:结束 -->
  <!-- 每条RSS新闻信息都包含在item节点中, -->
  <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>
  <!-- 新闻目录 -->
  <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://liftoff.msfc.nasa.gov/</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://liftoff.msfc.nasa.gov/news/2003/news-VASIMR.asp</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://liftoff.msfc.nasa.gov/news/2003/news-laundry.asp</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>

点赞 (0)

收藏 (0)

本站部分信息来源网络,如有侵权,请联系QQ:1062129401删除。

上一篇: 《建站管家》二次开发文档

下一篇: WordPress纯php代码网站地图、WordPress免插件生成完整站点地图(sitemap.xml)的php代码

请先登录后,再发表评论 ~ ~
发表评论
发表评论
发表帖子
广告位招租( ¥5 / 天 )
点击咨询
相关帖子

如果要判断文件是否存在,用函数 is_file(),如果要判断目录是否存在,用函数 is_dir()
用宝塔安装TP程序后,网站前台可以访问,后台无法访问,不是程序问题,而是web服务器环境配置问题(PHP配置),出现这种问题,一般是windows主机安装宝塔造成的,linux安装宝塔不会出现此错误
广告位招租( ¥3 / 天 )
点击咨询
广告位招租( ¥2 / 天 )
点击咨询
广告位招租( ¥1 / 天 )
点击咨询
最新帖子

小朋友,你爸爸是谁啊?这很单纯的,就像我们碰到别人会问:你吃过饭了吗?类似;许多人初次相识,经常会问:你是做什么的啊?你做什么,好像决定你收入的高低,你,资产的范围
1、升级框架到ThinkPHP8.0.3【要求PHP8.1+环境,推荐PHP8.1】 2、启用/禁用调试模式等小细节改进
后台点击生成站点地图 一直转圈圈没有反应,
在线客服