Asp + Rss reader page 1/2

Source: Internet
Author: User

Asp + Rss reader Creation
Transferred from Lingyun's BLOG
I just did a test here. You can use it to call the latest post on your site to facilitate user subscription.
The code for displaying the page of the RSS reader is as follows:

Copy codeThe Code is as follows: <! -- # Include file = "conn. asp" -->
<%
'******************************
'File name: index. asp
'Function: RSS reader display page
'Day: 2006-6-19
'Programming: Cloud. L
'******************************
Response. contentType = "application/xml; charset = gb2312"
%>
<? Xml version = "1.0" encoding = "gb2312"?>
& Lt; rss version = "2.0" & gt;
<Channel>
<Rssname> <% = SiteName %> </rssname>
<Author> <% = Author %> </author>
<Mail> <% = Mail %> </mail>
<%
SQL = "select top 20 * from [SIHRT_Rss] order by Rss_Date desc, Rss_ID desc"
Set Rs = Server. CreateObject ("Adodb. Recordset ")
Rs. open SQL, Conn, 1, 1
If Rs. eof and Rs. bof then
Response. Write "<listitems> <nodata> no list data </nodata> </listitems>"
Else
Response. Write "<listitems>"
Do while not Rs. eof
Rss_Cont = replace (Rs ("Rss_Cont"), "<br> ","")
%>
<Item>
<Rssid> <% = Rs ("Rss_ID") %> </rssid>
<Title> <% = Rs ("Rss_Title") %> </title>
<Postdate> <% = Rs ("Rss_Date") %> </postdate>
<Content> <! [CDATA [<% = Rss_Cont %>]> </content>
</Item>
<%
Rs. movenext
Loop
Response. Write "</listitems>"
End if
RsClose
Connclose
%>

</Channel>
</Rss>

The database connection file Conn. asp code is as follows:Copy codeThe Code is as follows: <! -- # Include file = "Const. asp" -->
<% Response. Buffer = True %>
<%
'******************************
'File name: Conn. asp
'Skill: RSS reader and database connection file
'Day: 2006-6-18
'Programming: Cloud. L
'******************************
Dim ConnStr, Conn
'Create Connection
ConnStr = "Provider = Microsoft. Jet. OLEDB.4.0; Data Source =" & Server. MapPath (DataPath)
Set Conn = Server. CreateObject ("Adodb. Connection ")
Conn. open ConnStr

'Close Rs
Sub RsClose
Rs. Close
Set Rs = nothing
End Sub

'Close Conn
Sub ConnClose
Conn. Close
Set Conn = nothing
End Sub
%>

The Const. asp code of the website information definition file is as follows:Copy codeThe Code is as follows: <%
'******************************
'File name: Const. asp
'Function: defines the constant of the RSS reading program.
'Day: 2006-6-18
'Programming: Cloud. L
'******************************
Const DataPath = "Data/RssData. mdb"
Const SiteName = "SIHRT--RSS reader"
Const Author = "Cloud. L"
Const Mail = "Sihrt@163.com"

%>

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.