Before starting this article, we must first understand what RSS is and the rules for using RSS.
Section 1RSS 2.0Specifications
Source: http://blogs.law.harvard.edu/tech/rss
Http://tonyqus.cnblogs.com/archive/2005/01/30/93684.aspx.
What isRSS?
RSS is a web content sydication format ).
Its name is the abbreviation of Really Simple Syndication.
RSS is a type of XML. All RSS documents comply with the XML 1.0 specification, which is published on the W3C website.
The beginning of an RSS document is an <rss> node and a specified attribute version, which specifies which version of the document will be represented by RSS. If this document uses this specification, its version attribute must be 2.0.
The lower level of the <rss> node is an independent <channel> node that contains information and content about the channel.
About this document
This document belongs to RSS version 2.0.1.
Required channel nodes
The following is a list of channel nodes that must be included. Each node has a simple description, an example, the location where it should appear, and a hyperlink with a more detailed description (take http://www.ppurl.com/feedas as an example ).
Element
Description
Example
Title
Channel name. It tells others how to access your service. If you have an HTML website with the same content as your RSS file, your title element value should be the same as the title of your website.
Pipi bookstore
Link
Response URL of the website of this channel
Http://www.ppurl.com
Description
Description of this channel
There are only some good e-books.
Optional channel Elements
The following lists the elements that can be included in an optional channel:
Node
Description
Example
Language
Language used. This allows the aggregators to group all sites in Italian.
En-us
Copyright
Copyright Notice
Copyright 2002, Spartanburg Herald-Journal
ManagingEditor
Email of the content owner
Geo@herald.com (George Matesky)
WebMaster
Technical staff Email
Betty@herald.com (Betty Guernsey)
PubDate
Content release time
Sat, 07 Sep 2002 00:00:01 GMT
LastBuildDate
Last Update Time
Sat, 07 Sep 2002 09:42:31 GMT
Category
Specifies the category to which the channel belongs. Follow the same rule as the item-level category element.
<Category> Newspapers </category>
Generator
Generate the program name for this channel
MightyInHouse Content System v2.3
Docs
Url pointing to an rss document?
Http://blogs.law.harvard.edu/tech/rss
Cloud
Allows all processes to register a cloud for Channel update notifications and implement a lightweight publish/subscribe protocol for rss seeds.
<Cloud domain = "rpc.sys.com" port = "80" path = "/RPC2" registerProcedure = "pingMe" protocol = "soap"/>
Ttl
Ttl is short for Time to live. It indicates the effective retention time of the cache.
<Ttl> 60 </ttl>
Image
Image address displayed with the Channel
Rating
The Statistical Image address of this channel
TextInput
Specify a textbox to display with this channel
SkipHours
Tell users which time periods can be ignored
SkipDays
Indicates which days can be ignored
The following describes several common subnodes in the channel element:
<Channel>Subnode<Image>
L <image> is an optional <channel> subnode, which contains three required child elements and three optional child elements.
L <url> is the URL of a GIF, JPEG, or PNG image file. The image represents the entire channel.
L <title> is used to describe the preceding image. It is equivalent to the alt attribute of in HTML.
L <link> is the url of the site to be connected. When a channel is displayed, the image connection points to the site.
L <title> and <link> must have the same value as <title> and <link> of the channel.
L optional nodes include <width> and
L <description> is the text in the TITLE attribute of link. It will be displayed when a webpage is called.
Note:
The maximum image width is 144, and the default value is 88.
The maximum image height is 400. The default value is 31.
<Channel>Subnode<Cloud>
<Cloud> is an optional <channel> subnode.
It specifies a web service that supports the rssCloud interface, which can be implemented with a HTTP-POST, XML-RPC, or SOAP1.1.
It aims to allow the process channel registered as cloud to be updated to implement a lightweight publish and subscribe protocol.
<Cloud domain = "rpc.sys.com" port = "80" path