Add RSS for your website

Source: Internet
Author: User
When you browse the site RSS feed page (http://rss.ccw.com.cn), you can see that the site for the convenience of users to customize the content of each RSS channel. By subscribing to different RSS feeds (multiple websites can be subscribed at the same time), viewers can obtain timely news without logging on to the website, it can also avoid unwanted advertisements and junk information interference on webpages. Using RSS will save a lot of time for viewers, and it will also become a highlight of the humanized design of the website, improving the grade of the website.

In fact, RSS technology is not too difficult. If your website has a large amount of information, you can apply this technology to your site.

TIPS: What is RSS?

RSS is a simple way to share content between sites (also known as "aggregate content"). It is usually used for news and other websites in order, such as blog websites. The website provides RSS output to help users discover updates to website content. Website users can read the content of the website that supports RSS output without opening the website content page by using the news aggregation tool software such as news and information reader on the client.

I. Know Yourself And know each other.

To create RSS for a website, we must first have a deep understanding of RSS. RSS is a form based on XML (Extensible Markup Language), and all RSS files must comply with XML 1.0 standards published by the W3C site. Generally, the top layer of an RSS document is an <RSS> element as the root element. The <RSS> element has a mandatory attribute version to specify the version of the current RSS document, currently, the commonly used RSS version is 2.0. The sub-element under the <RSS> element is the only <channel> element that contains information and content about the website or topic, there are three necessary statements under <channel>:

<Title>: The name of a website or column, which is generally the same as the title of a website or column;
<Link>: the URL of a website or column;
<Description>: A Brief Description of a website or topic.

You can also use optional statements such as <language> and <copyright> to enrich <channel> content, the specific news feed depends on <item>. A piece of news is generally a <item>, and at least one <title> or <description> must exist under <item>. Other statements can be selected as needed.

Tip: For more information about RSS statements, see http://www.donews.net/softbunny/articles/11030.aspx. When learning RSS statements, you can use IE to open an XML link for Reference reference. For example, the topic Network Communication Section aggregates the content http://rss.chinabyte.com/218108581927469056.xml.

, RSS, manual Creation

After learning about the specific RSS statement structure and usage, We can manually edit the RSS of the website in the most common notepad or webpage editing software in the following format.

<? XML version = "1.0" en Coding = "gb2312"?>
<RSS version = "2.0">
<Channel>
<Title> name of a website or topic </title>
<Link> URL of a website or column </link>
<Description> brief introduction to the website or topic </description>
<Item>
<Title> News Title </title>
<Link> News URL </link>
<Description> brief introduction to news </description>
<Pubdate> News release time </pubdate>
<Author> News author name </author>
</Item>
<Item>
......
</Item>
</Channel>
</RSS>

The Chinese text and ellipsis are the parts for adding news. You can save them as follows. XML file, add the "XML" icon to the appropriate location of the website, and then link to. XML file, so that your website has RSS output.

Iii. Easy to write tools

If there is a large amount of news updated on the website, errors may occur when you manually compile the RSS file. We can ask the RSS generator (: http://sq.onlinedown.net/down/rsscreator.rar) to help us work. Open the software and execute "File> New> RSS" to create an RSS file (figure 1 ). First, enter "Description", "Link", and "title" in the "mandatory element" area above, to add a news entry, click the button after "items" to enter the news addition window (figure 2). Click "add" to add a news entry, then, add the title, description, and link in the Statement on the left, and return to the main interface of the software, press the Save button in the toolbar to save the document. XML file.

Tip: the RSS generator requires support for. NET Framework, before installing it in http://go.microsoft.com/fwlink? Linkid = 9832 download and install the. NET Framework Package.

4. Automatic Generation, once and for all

For static websites, you can write RSS output manually or using tools.ProgramTo convert the news database content to output RSS. If you are interested, you can. In addition, when reading database fields and assigning values to fields such as the news title and link, you must make some modifications based on the specific situation of the database. After successful Debugging Using this template, the RSS output address of the website is http: // your domain name/rss2.asp.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.