RSS <channel> Element

Yarancin <channel> na RSS zai bayyana RSS feed.

RSS <channel> Element

Kai tsaye kira wannan abin da ake samar da RSS:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
  <title>CodeW3C.com Home Page</title>
  <link>http://www.codew3c.com</link>
  <description>Free web building tutorials</description>
  <item>
    <title>RSS Tutorial</title>
    <link>http://www.codew3c.com/rss</link>
    <description>New RSS tutorial on CodeW3C.com</description>
  </item>
</channel>
</rss>

Duba cewa a cikin kwanan nan, yarancin <channel> zai bayyana RSS feed, kuma yana da ɗaukar yarancin uku na dama:

  • <title> - taɓa cikin hada da sunan gaba.(karimci CodeW3C farko)
  • <link> - taɓa cikin hada da kwayar haɗin gwiwar da za a iya samun shi.(karimci www.codew3c.com)
  • <description> - bayanin wannan gaba (karimci bayanin samar da yanar gizo)

<channel> kuma yana da cikakken <item> yarancin. Kowane yarancin <item> zai iya gudanar da samar da wucin gadi ko "story" a cikin RSS feed.

Bai hanyar hakan, akwai ɗaukar yarancin <channel> da za a gudanar da su a bayan.

<category> yarancin

<category> yarancin yana daɗin kai samar da nau'ikan feed.

<category> yarancin yana daɗin kai tsarewa abin da ke cikin RSS yana kewayiwa domin samar da gaban yanar gizo a cikin kudi.

Anu na kafa RSS na abin da yake zai zai zai:

<category>Web development</category>

<copyright> 元素

<copyright> 子元素会告知有关版本资料的信息。

上面的 RSS 文档的版本可能会是

<copyright>2006 codew3c.com. All rights reserved.</copyright>

<image> 元素

<image> 子元素可在聚合器提供某个 feed 时显示一幅图像。

<image> 有三个必需的子元素:

  • - 定义引用图像的 URL
  • - 定义图像无法被显示时显示的文本
  • <link> - 定义到达提供此频道的网站的超链接

上面的 RSS 文档的图像可能是这样的:

<image>
  <url>http://www.codew3c.com/images/logo.gif</url>
  <title>codew3c.com</title>
  <link>http://www.codew3c.com</link>
</image>

<language> 元素

<language> 子元素用于规定用来编写文档的语言。

<language> 元素使 RSS 聚合器基于语言来对网站进行分组成为可能。

上面的 RSS 文档的语言可能是:

<language>en-us</language>

RSS <channel> 参考手册

元素 描述
<category> 可选的。为 feed 定义所属的一个或多个种类。
<cloud> 可选的。注册进程,以获得 feed 更新的立即通知。
<copyright> 可选。告知版权资料。
<description> 必需的。描述频道。
<docs> 可选的。规定指向当前 RSS 文件所用格式说明的 URL。
<generator> 可选的。指定用于生成 feed 的程序。
<image> 可选的。在聚合器呈现某个 feed 时,显示一个图像。
<language> 可选的。规定编写 feed 所用的语言。
<lastBuildDate> 可选的。定义 feed 内容的最后修改日期。
<link> 必需的。定义指向频道的超链接。
<managingEditor> 可选的。定义 feed 内容编辑的电子邮件地址。
<pubDate> Optional. Defines the last published date of the feed's content.
<rating> Optional. The PICS rating of the feed.
<skipDays> Optional. Specifies the days to ignore for feed updates.
<skipHours> Optional. Specifies the hours to ignore for feed updates.
<textInput> Optional. Specifies the text input field that should be displayed along with the feed.
<title> Required. Defines the title of the channel.
<ttl> Optional. Specifies the number of minutes a feed can be cached before it is updated from the feed source.
<webMaster> Optional. Defines the email address of the webmaster of this feed.