Tip: Create a summary of RSS content for a Web site

Source: Internet
Author: User
Tags format client
rss| Create | tips

RSS is a "lightweight, multi-purpose, extensible metadata description and joint promotion format", can also be understood as a specification. It is itself an XML format used to provide selective, aggregated Web content for content consolidation clients. Today, many sites start by creating RSS feeds to provide content integration services to viewers, providing news, site content updates, and so on. Visitors can easily get these organizations and aggregated information through some client software.

So, how do you create an RSS feed on our own web site? Let me take asp+access as an example to introduce.

Since RSS is an XML-formatted document, then we should be able to filter the data in the background database according to the conditions, and then generate the data stream in XML format through ASP, and finally send it to the client for browsing.

The selection and collection of data is the forte of ASP, and the key is how to generate the data stream in XML format. In fact, the ASP has its own solution, is to write the data on the response object of the ContentType attribute to define. If response. The value of ContentType is "Text/xml", and the data stream in XML format is sent to the viewer.

The method of calling an RSS feed in IE is no different from a normal link, in the form of:

RSS description

One of the type= "Application/rss+xml" plus does not add as if there is no difference.

The following program segment is the source code for the RSS feed for the "Technical News" section of the "100,000 Why" (http://www.why100000.com/) of my web site, the file name is rssfeed_news.asp.

Where the variable sxmlclear is used to declare that the resulting document is an XML-formatted document that is optional to maintain backward compatibility with older versions of XML.

Srsshead defines the basic elements of RSS. RSS feeds typically consist of 4 main elements: <CHANNEL>,,<ITEM> and <TEXTINPUT>. Where the,<channel> element is a required,<item> element must appear at least once. The <TEXTINPUT> and elements are optional and are to be used depending on the circumstances.

element contains a simple description of the Channel (the source of the RSS feed).



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.