It’s very depressing that Google Reader started to read RSS only after it fell. InoReader is a good alternative. I want to have an understanding of the principles of RSS, but the information on the Internet is not very clear. There is a blog post on the principle and implementation of RSS on RSS, and I also found a good article on the Reference of the Wiki. The translation is as follows:
What is RSS?
RSS is a type of The format specification for shared messages, this format specification Defined in the XML 1.0 version. You can pass this This format transmits information to other people, and can receive messages from various sources through this format. provided by a website The information recorded in a specific XML file is called RSS feed.
Recent browsers can read RSS files directly, but you need to use a special RSS reader or aggregator.
< span style="font-size:24px">RSS history
RSS was developed by Netscape in 1999. The first version is RSS 0.90. In 2000, UserLand improved and released the official 0.91 specification.
2000,O’Reilly developed an RSS 1.0 specification based on RDF, which was further maintained by the RSS-DEV team and named RDF Site Summary.
In 2002, Dave Winer (former UserLand employee) developed RSS 2.0 at Harvard University.
This page is based on Really Simple Syndication, Harvard University’s2.01 specification. (This page is based on theReally Simple Syndication , 2.01 specification from Harvard. I don’t know how to translate this sentence, I hope someone will guide you).
Why use RSS?
in a specific format that the computer can process to obtain the information or news provided by the website. The information or news will be displayed on the web page, or for yourself to read.
For content providers, RSS allows him to send information and news on his own website.
< div style="font-family:Tahoma; orphans:2; widows:2; text-align:justify"> How does RSS work?
The principle of the RSS system for publishing articles and news through the Internet is very simple:
1. First, we have some pages that we want to display on other web pages. These pages are called RSS feeds.
2. The RSS feed is defined by an XML file that includes each page you want to display URL, title and summary.
3. If you want to read the RSS feed on your computer, just use an RSS reader or browse Reader, add these feeds to your reader.
4. If other recipient websites want to display the feed, they need to obtain the RSS file from the provider and extract it URL page, and display title and summary. These tasks can be done through PHP scripts.
5. When someone wants to visit the recipient’s website, start the script and call from the provider’s website Get the RSS file, extract the information to display the news list
6. By clicking a certain item in the news list One, you can visit the original webpage of the news provider.
RSS document structure< /span>
RSS document is an XML file and a generic 2.0 standard “RSS” tag container.
This file has at least one channel. The content is the information provided by the website.
channel provides some articles and data from the same or different websites.
< div style="font-family:Tahoma; orphans:2; widows:2; text-align:justify"> How to use RSS?
1-Use RSS in desktop applications< /span>
RSS feed viaInternet Explorer 7 orFirefox 2 is displayed. An RSS reader (or aggregator) can also be installed in the operating system (Windows, Linux, Mac OS, etc.). Among the reference materials, there is one built by XUL.
The content obtained depends on the reader. To add a feed to the list, you may only need to click the “Add” button to get the URL of the RSS feed.
2-Use feed in the website< /span>
< span style="font-family:Tahoma,Arial; line-height:24px">RSS feed is displayed as a list of headlines (or an optional summary). Click on a specific headline to display news content. The title is automatic update. Whenever the page loads an RSS file and extracts data from it,PHP or other language scripts create a new list and display it on the page. Links to some of these tools are provided in the references.
How to publish news via RSS feed?
There are several ways to generate RSS feeds.
Use PHP’s RSS library. PHP scripts can generate XML files from the title and description of the page content.
Use special tools to extract information from the page.
gives an access link to an XML file as shown on the right:< /span>
< pre code_snippet_id="330867" snippet_file_name="blog_20140506_1_1338351" name="code" class="html"> RSS feed for this sitefeed uses “application/atom+xml” instead in Atom format. Replace xul.fr with the domain name of your website.
Noun explanation Feed. A collection of “item” tags, a collection of information or news. RDF. See the RDF page of this website Syndicated. Published through an RSS feed. · Syndication. Publishing data by RSS feeds.
Main RSS tags rss. General container channel. A distributing channel. It contains several descriptive tags and one or more items.
... rss>
The necessary tags in the channel
title. The title of the channel. Should include the name.
link. Provided The website URL of the channel.
description. Provide A summary of the information of the person.
item. At least Need an item tag to provide content.
XUL http://www.xul.fr < item> ...
Optional tags in the channel
· language. The natural language (English, Chinese, etc.) used in the text.
docs. Provide The location of the document in the file format may be Harvard University.
· webMaster. E -mail
pubDate . release time.
etc. Participate in more specification documents.
< /span>
channel Item
Each item tag must contain the following tags:
title. The title of the article.
link. article the link to.
description. Article Summary.
XUL news http://www.xul.fr/index.php ... some text...
Some optional item tags:
pubDate. Publish time.
guid. Specify The unique character string of the item
cate gory. Article classification
· etc.
Create a personal RSS feed step by step
First of all, this is just a simple text file, created by any text editor. But using an XML editor will be more convenient. (See the “software” page). The file name can be “feed.xml”.
The overall structure is as follows:
1) Define the source through the channel tag
< div style="font-family:Tahoma; orphans:2; widows:2; text-align:justify"> channel will be the same for all your RSS feeds. The following tags are required:
-title: The name of your website, which may be the content of the title tag of your homepage.
-link: you The URL of the website, for example: http://www.xul.fr
< span style="font-size:14px">-description: The description of your website, about 200 characters, may be the content of the description tag in the title area of your homepage.
XUL and XMLhttp://www.xul.fr/en/XML graphical interface etc...< /description>
2) Add images
This is an option. Design a small chart (such as 88×31), use common formats (gif, jpg, png) and place it in the same directory as the RSS file.
“image” tag It is a child element of the channel tag.
-url is an image Address
-link Is the address of the link when the image is clicked
Now, we will add a web page to display information. It is implemented by the “item” tag, which is the child element and necessary component of the channel.
-title: Title of the article
-link: URL of the page
-description: summary of the article, about 200 characters
News of todayhttp://www.xul. fr/en-xml-rss.htmlAll you need to know about RSS
4) Add more items
More items can be added to this channel
5) Upload files
Put the feed.xml file on your website and put it together with other web pages.
6) Verify the file
You may need to use an online RSS feed validator.
7) Make RSS available
Add an RSS button to the homepage. Click the button to display the XML file you created
8) Update feed
You only need to add item tags to publish more articles, and delete old item tags to keep the total number of articles constant.
< /span>
Example: Complete file
Ajax and XUL http: //www.xul.fr/en/ XML graphical interface etc...http://www.xul.fr/xul-icon.gif< /url> http://www.xul.fr/en/index.php News of today http://www .xul.fr/en-xml-rss.html All you need to know about RSSNews of tomorrows http://www.xul.fr/e n-xml-rdf.html And now, all about RDF
You can download the example and use it as a template, remember to replace it with the domain name of your website xul.fr.
< /span>
Browser How do I know that there is an RSS feed on the website?
You have created the RSS feed, and it is now stored in the root directory of your website. When the browser enters the homepage (or other page you want), you must let it know the existence of this file and its location. Firefox will display the feed icon in the URL area, andInternet Explorer will be displayed in the control bar.
To activate them, insert the following code into the source code of your webpage anywhere in the section.
Replace this URL with the location of the RSS feed file under the domain name of your website.
If the file is in atom format, replace rss+xml with atom+xml
< /div>
Specifications and tools
Document specifications
RSS 2.0 specification. Defined by Harvard.
RSS 1.0 Tutorial .
Tool to generate and display RSS feed
Feed Validator. Enter the URL of your file to check the feed.
News of todayhttp://www.xul.fr/en-xml-rss.htmlAll you need to know about RSS
4)添加更多item
更多item可以被添加到这个channel
5)上传文件
将feed.xml文件放到你的网站中,和其他网页放在一起。
6)验证文件
你也许需要使用在线的RSS feed validator。
7)使RSS可获得
在主页里添加RSS按钮。点击按钮需要显示你所创造的XML文件
8)更新feed
你仅需要添加item标签来发布更多的文章,删除旧的item标签来保持总文章数一定。
例子:完整的文件
Ajax and XUL http://www.xul.fr/en/ XML graphical interface etc...http://www.xul.fr/xul-icon.gif http://www.xul.fr/en/index.php News of today http://www.xul.fr/en-xml-rss.html All you need to know about RSSNews of tomorrows http://www.xul.fr/en-xml-rdf .html And now, all about RDF
News of todayhttp://www.xul.fr/en-xml-rss.htmlAll you need to know about RSS
4)添加更多item
更多item可以被添加到这个channel
5)上传文件
将feed.xml文件放到你的网站中,和其他网页放在一起。
6)验证文件
你也许需要使用在线的RSS feed validator。
7)使RSS可获得
在主页里添加RSS按钮。点击按钮需要显示你所创造的XML文件
8)更新feed
你仅需要添加item标签来发布更多的文章,删除旧的item标签来保持总文章数一定。
例子:完整的文件
Ajax and XUL http://www.xul.fr/en/ XML graphical interface etc...http://www.xul.fr/xul-icon.gif http://www.xul.fr/en/index.php News of today http://www.xul.fr/en-xml-rss.html All you need to know about RSSNews of tomorrows http://www.xul.fr/en-xml-rdf.html And now, all about RDF