Asp+rss reader make 1th/2 page _xml/rss

Source: Internet
Author: User

Asp+rss Reader Production
Turn from Lingyun's blog
I just made a test here. We can use it to specific applications, call their own site in the latest posts to facilitate user subscriptions.
The RSS reader displays the page code as follows:

Copy Code code as follows:

<!--#include file= "conn.asp"-->
<%
'******************************
' FileName: index.asp
' Function: RSS reader Display page
' Date: 2006-6-19
' Programming: CLOUD.L
'******************************
Response.contenttype= "application/xml;charset=gb2312"
%>
<?xml version= "1.0" encoding= "gb2312"?>
<rss version= "2.0" >
<channel>
<rssname><%=SiteName%></rssname>
<author><%=Author%></author>
<mail><%=Mail%></mail>
<%
Sql= "Select" 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 as 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 link file conn.asp code is as follows:
Copy Code code as follows:

<!--#include file= "const.asp"-->
<%Response.Buffer=True%>
<%
'******************************
' FileName: conn.asp
' Function: RSS reader and database connection file
' Date: 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 site information definition file const.asp code is as follows:
Copy Code code as follows:

<%
'******************************
' FileName: const.asp
' function: Define RSS reader Constants
' Date: 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"

%>


Current 1/2 page 12 Next read the full text
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.