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