ASP dynamically generate RSS (no raw XML file) code _ Application Skills

Source: Internet
Author: User
Tags cdata format definition generator
The benefits of RSS
1. You can selectively browse the news that you are interested in and related to your work.
2. You can isolate the information you need from unwanted information (peddling information, spam, etc.).
3. You can create your own news channels and publish them to the Internet.
What is RSS?
RSS refers to really Simple Syndication (real Easy Union)
RSS gives you the ability to aggregate (Syndicate) Web site content
RSS defines a very simple way to share and view headings and content
RSS files can be updated automatically
RSS allows personalization of views for different sites
RSS is written using XML
RSS is a way to distribute Web content on a Web site to many other Web sites using XML.
RSS gives us the ability to quickly browse news and updates.
Why use RSS?
RSS is designed to show the selected data.
Without RSS, users will have to come to your site every day to check for new content. This is too time-consuming for many users. With RSS feeds (often called News feeds or RSS feeds), users can use RSS aggregators to quickly check your site updates (RSS aggregators are sites or software that aggregate and categorize RSS feeds).
Because RSS data is small and fast to load, it can be easily used by services like mobile phones or PDAs.
Web sites with similar content (web-rings) can easily share content on their web sites, making them more valuable and worthwhile.
The future of RSS
RSS will be everywhere!
Thousands of websites are using RSS, and every day more and more people are aware of its usefulness.
With RSS, information on the Internet is easier to find, and web developers can more easily spread their content to specific audiences.
Know so much below let's experience RSS together!
Add RSS feed to your site
Save the following file as rss.asp in the root directory of the site to modify several parameters inside
Program code
Copy Code code as follows:

<!--#include file= "conn.asp"-->
<%
Sxmlclear = "<?xml version= ' 1.0 ' encoding= ' gb2312 '?> '"
response.charset= "gb2312" Data set encoding
Response.contenttype= "text/xml" Data flow format definition
%>
<%=sXmlClear%>
<rss version= "2.0" >
<channel>
<title><! [cdata[Countryman ' blog]]></title>
<link>http://xxrblog.cn/</link>
<description><! [cdata[site subtitle or site profile]]></description>
<language>zh-CN</language>
<copyright>
<! [cdata[Copyright PBlog2 v2.4]]>
</copyright>
<webMaster>
<! [cdata[24525533@163.com (Li Yongliang)]]>
</webMaster>
&LT;GENERATOR&GT;PBLOG2 v2.5</generator>
<image>
<title> Countryman ' blog xxrblog.cn</title>
<url>http://www.xxrblog.cn/images/logos.gif</url>
<link>http://www.xxrblog.cn/</link>
<description> Countryman ' blog xxrblog.cn</description>
</image>
<%
Set rs = Server.CreateObject ("ADODB.") Recordset ")
Sql= "SELECT top * from News ORDER BY id DESC"
Rs.Open sql,conn,3,3
Do as not rs.eof
Content=rs ("Content")
If Len (contact) >150 Then
Content=left (content,147) & "..."
End If
%>
<item>
<title><%=rs ("title")%></title>
<description><! [cdata[<%=content%>]]></description>
&LT;LINK&GT;HTTP://XXRBLOG.CN/ARTICLE.ASP?ID=&LT;%=RS ("id")%></link>
<author> author </author>
<pubdate><%=rs ("Time")%></pubdate>
</item>
<%
Rs.movenext ()
Loop
Rs.close ()
Set rs = Nothing
Conn.close
%>
</channel>
</rss>
The above content by my test can be used
Related Article

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.