ASP dynamic generation of RSS (not generated XML file) Code

Source: Internet
Author: User
Tags format definition

Advantages of RSS
1. You can selectively browse the news you are interested in and related to your work.
2. You can separate the unwanted information (such as selling information and spam.
3. you can create your own news channels and publish them to the Internet.
What is RSS?
RSS refers to Really Simple Syndication (truly simple combination)
RSS enables you to aggregate (Syndicate) website content
RSS defines a very simple way to share and view titles and content
RSS files can be automatically updated
RSS allows personalization of views for different websites
RSS is written in XML
RSS is a way to use XML to distribute network content on a website to many other websites.
RSS enables us to quickly browse news and updates.
Why RSS?
RSS is designed to display selected data.
If you do not have RSS, you have to check new content on your website every day. This is too time-consuming for many users. Through RSS feed (RSS is usually called news feed or RSS feed ), users can use RSS aggregators to check your website updates more quickly (RSS aggregators are websites or software used to aggregate and classify RSS feeds ).
Because RSS data is small and can be quickly loaded, it can be easily used by services similar to mobile phones or PDAs.
Websites with similar content (Web-rings) can easily share content on their websites to make these websites better and more valuable.
The future of RSS
RSS is everywhere!
Thousands of websites are using RSS, and more people recognize its usefulness every day.
Through RSS, information on the internet is easier to find, and website developers can easily spread their content to specific audiences.
After learning so much about RSS, let's try RSS!
Add RSS reading for your website
Save the following file as RSS. asp and place it in the root directory of the website. Modify the parameters.
Program Code Copy code The Code is as follows: <! -- # Include file = "conn. asp" -->
Sxmlclear = "<? XML version = '1. 0' encoding = 'gb2312 '?> "
Response. charset = "gb2312" 'dataset Encoding
Response. contenttype = "text/XML" 'data stream format definition
<% = Sxmlclear %>
& Lt; RSS version = "2.0" & gt;
<Title> <! [CDATA [folks 'blog]> </title>
<Description> <! [CDATA [website subtitle or website Introduction]> </description>
<Language> ZH-CN </language>
<! [CDATA [copyright 2005 pblog2 v2.4]>
<! [CDATA [ (Li Yongliang)]>
<Generator> pblog2 v2.5 </generator>
<Title> country folks 'blog </title>
<URL> </URL>
<Description> country folks 'blog </description>
Set rs = server. Createobject ("ADODB. recordset ")
SQL = "select top 10 * from news order by ID DESC"
Rs. Open SQL, Conn, 3, 3
Do while not Rs. EOF
Content = RS ("content ")
If Len (contact)> 150 then
Content = left (content, 147 )&"..."
End if
<Title> <% = RS ("title") %> </title>
<Description> <! [CDATA [<% = content %>]> </description>
<Link> Id = <% = RS ("ID") %> </link>
<Author> author </author>
<Pubdate> <% = RS ("time") %> </pubdate>
Rs. movenext ()
Rs. Close ()
Set rs = nothing
Conn. Close

The above content has been tested and 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: 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.