tsys _rss程序
程序员文章站
2023-11-04 20:46:52
示例地址: http://www.18eden.com/rss.asp 站点:http://www.18eden.com/jiankang 该程序放根目录 或者其他目录,地...
示例地址:
http://www.18eden.com/rss.asp
站点:http://www.18eden.com/jiankang
该程序放根目录
或者其他目录,地址自己改,读出最新的20条资源.( 可以修改成读取get叁数的形式)
自动判断网站地址端口,无需要人工干预.
<% option explicit %>
<!--#include file="manage/include/config.do" -->
<%
dim ssql, rs, scrlf, sxmlclear, srsshead, srssend ,url
scrlf = chr(13) & chr(10) '回车+换行
if request.servervariables("https") = "on" then
url = "https://"
else
url = "http://"
end if
url=url&request.servervariables("server_name")&":"&request.servervariables("server_port")
sxmlclear = "<?xml version='1.0' encoding='gb2312'?>" & scrlf
'srsshead ="<rdf:rdf xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:sy='http://purl.org/rss/1.0/modules/syndication/' xmlns:admin='http://webns.net/mvcb/' xmlns='http://purl.org/rss/1.0/'>"
srsshead = "<rss version='2.0'>" & scrlf
srsshead = srsshead & "<channel>" & scrlf
srsshead = srsshead & "<title> "& def_mysitetitle &" </title>" & scrlf
srsshead = srsshead & "<description> "& def_systitle &" </description>" & scrlf
srsshead = srsshead & "<link>" & url& "</link>" & scrlf
srsshead = srsshead & "<language>zh-cn</language>" & scrlf
srsshead = srsshead & "<docs>news center</docs>" & scrlf
'srsshead = srsshead & "<dc:creator>yezhan,okhtm@msn.com</dc:creator>" & scrlf
srsshead = srsshead & "<generator>rss generator</generator><items>" & scrlf
srssend = "</items></channel></rss>"
'response.charset="gb2312" '数据集
response.contenttype="text/xml" '数据流格式定义
response.contenttype="application/xml"
response.expires=0
response.write sxmlclear
response.write srsshead
dim conn
set conn = server.createobject("adodb.connection")
conn.open connstr
dim sql
sql="select top "& rssnewslist_pagesize &" title,filepath,addtime,keyword,content,classtitle,editortitle from view_newsinfo where del=0 order by addtime desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,2
if rs.eof and rs.bof then
response.write("<item></item>")
else
do while not rs.eof
response.write("<item>")&rs("title")
response.write("<title><![cdata["&rs("title")&"]]></title>")
response.write("<description><![cdata["&rs("keyword")&"]]>")
response.write("<content><![cdata["&rs("content")&"]]></content>")
response.write("<link>" &url&rs("filepath")&"</link>")
response.write("<subject>"&rs("classtitle")&"</subject>")
response.write("<creator>"&rs("editortitle")&"</creator>")
response.write("<date>"&rs("addtime")&"</date>")
response.write("</description></item>")
rs.movenext
loop
end if
rs.close
set rs=nothing
response.write srssend
%>
陆续放出少年不在修改版 tsys修改办法```
http://www.im286.com/thread-1370996-1-1.html
http://www.18eden.com/rss.asp
站点:http://www.18eden.com/jiankang
该程序放根目录
或者其他目录,地址自己改,读出最新的20条资源.( 可以修改成读取get叁数的形式)
自动判断网站地址端口,无需要人工干预.
复制代码 代码如下:
<% option explicit %>
<!--#include file="manage/include/config.do" -->
<%
dim ssql, rs, scrlf, sxmlclear, srsshead, srssend ,url
scrlf = chr(13) & chr(10) '回车+换行
if request.servervariables("https") = "on" then
url = "https://"
else
url = "http://"
end if
url=url&request.servervariables("server_name")&":"&request.servervariables("server_port")
sxmlclear = "<?xml version='1.0' encoding='gb2312'?>" & scrlf
'srsshead ="<rdf:rdf xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:sy='http://purl.org/rss/1.0/modules/syndication/' xmlns:admin='http://webns.net/mvcb/' xmlns='http://purl.org/rss/1.0/'>"
srsshead = "<rss version='2.0'>" & scrlf
srsshead = srsshead & "<channel>" & scrlf
srsshead = srsshead & "<title> "& def_mysitetitle &" </title>" & scrlf
srsshead = srsshead & "<description> "& def_systitle &" </description>" & scrlf
srsshead = srsshead & "<link>" & url& "</link>" & scrlf
srsshead = srsshead & "<language>zh-cn</language>" & scrlf
srsshead = srsshead & "<docs>news center</docs>" & scrlf
'srsshead = srsshead & "<dc:creator>yezhan,okhtm@msn.com</dc:creator>" & scrlf
srsshead = srsshead & "<generator>rss generator</generator><items>" & scrlf
srssend = "</items></channel></rss>"
'response.charset="gb2312" '数据集
response.contenttype="text/xml" '数据流格式定义
response.contenttype="application/xml"
response.expires=0
response.write sxmlclear
response.write srsshead
dim conn
set conn = server.createobject("adodb.connection")
conn.open connstr
dim sql
sql="select top "& rssnewslist_pagesize &" title,filepath,addtime,keyword,content,classtitle,editortitle from view_newsinfo where del=0 order by addtime desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,2
if rs.eof and rs.bof then
response.write("<item></item>")
else
do while not rs.eof
response.write("<item>")&rs("title")
response.write("<title><![cdata["&rs("title")&"]]></title>")
response.write("<description><![cdata["&rs("keyword")&"]]>")
response.write("<content><![cdata["&rs("content")&"]]></content>")
response.write("<link>" &url&rs("filepath")&"</link>")
response.write("<subject>"&rs("classtitle")&"</subject>")
response.write("<creator>"&rs("editortitle")&"</creator>")
response.write("<date>"&rs("addtime")&"</date>")
response.write("</description></item>")
rs.movenext
loop
end if
rs.close
set rs=nothing
response.write srssend
%>
http://www.im286.com/thread-1370996-1-1.html
上一篇: 如何从数据库中随机取出10条记录的方法
推荐阅读