ASP implements simple creation website RSS content summary RSS is a "lightweight, multi-purpose, scalable metadata description and joint promotion format", or it is also understood as a specification. It itself is an XML format for providing selective, summarized web content for content integration clients. Today, many sites are open
Enter the content integration service to the viewer by creating RSS feeds, providing information, site content update, and so on. The viewer can easily obtain these organizations, summarize the information through some client software.
So how do you create RSS feeds on our own website? Here I introduce asP Access as an example.
Since RSS is a document in XML format, then we should be able to filter data in the background database, organize, organize, and then generate data streams in XML format via ASP, and finally send it to the client to browse.
The selection of data, the collection is the ASP's easy drama, the key is how to generate data streams in XML format. In fact, ASP also has its own solution, which is defined on the ContentType property of the response object before writing data. If the value of Response.ContentType is "Text / XML", the data stream in XML format is sent to the viewer.
There is no difference between the method and the normal link to call the RSS source in the IE browser. The format is: r 说明 说明 where Type = " Application / RSS XML "does not add as if there is no difference.
The following block is the source code for the "Technical News" column on my website "100,000" (www.why100000.com), the file name is RSSFeed_News.asp. Among them, the variable Sxmlclear is used to declare the document generated by a XML format, which is optional to keep backward compatibility with the old version XML. SRSSHEAD defines the basic element of the RSS. RSS feeds are usually composed of 4 main elements:
<% OPTION Explicit%>
<% DIM SSQL, RS, SCRLF, SXMLCLEAR, SRSSHEAD, SRSSEND SCRLF = CHR (13) & Chr (10) 'Enter Wrap Sxmlclear = " XML Version =' 1.0 'Encoding =' GB2312 '?>" & Scrlf
sRssHead = "
Srssend = " channel> rss>"
Response.Charset = "GB2312" Dataset Response.ContentType = "text / xml" "Data Standfinder Definition
'Output: Response.write Sxmlclear Response.write SRSSHEAD
SSQL = "SELECT TOP 15 * from news = server.createObject (" adodb.recordset ") RS.Open SSQL, S_CONN, 1, 1 if not (rs.eof and ly) THEN DO While Not Rs.eof Response.write "
RS ("f_i_autoid" & " link>" & SCRLF response.write "
The call format in IE is: Technical News
RSS . If you subscribe to the RSS with some client software, the URL subscribed is
Http://www.why100000.com/_news/rssfeed_news.asp.