可以应用到马克斯电影站生成Rss Feed的代码
程序员文章站
2022-05-28 16:06:57
使用方法:将下面的代码存为rss.asp(记得以utf-8格式保存)并上传到网站根目录,剩下的工作就是找rss提交入口去提交你的feed地址http://你的域名/rss....
使用方法:将下面的代码存为rss.asp(记得以utf-8格式保存)并上传到网站根目录,剩下的工作就是找rss提交入口去提交你的feed地址http://你的域名/rss.asp
演示:http://www.366mv.cn
代码如下,请根据注释修改相应的信息,版权信息还望各位能够保留 ^_^
<%@language="vbscript" codepage="65001"%>
<%
session.codepage=65001
response.charset="utf-8"
'========================================================================
'copyright (c) 2005-2007, 酸溜溜影视([url]www.366mv.cn[/url]) all rights reserved.
'========================================================================
'名称: rss.asp
'描述: 动态生成rss feed。
'========================================================================
%>
<!--#include file=inc/conn.asp--><?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/atom">
<%
title="酸溜溜影视" '改成你自己的名称
response.write" <channel>"&chr(13)
response.write"<atom:link href=""http://"&maxz_2&"/xml.asp"" rel=""self"" type=""application/rss+xml"" />"&chr(13)
response.write" <title>最近更新影片 - "&title&"</title>"&chr(13)
response.write" <link>http://"&maxz_2&"</link>"&chr(13)
response.write" <description>"&title&" - 万部影片在线观看。免费电影,在线电影,tvb,日剧,韩剧,动漫,科幻,恐怖,言情,连续剧,大片,贺岁片……</description>"&chr(13)
response.write get_left(15,0) '显示前15部影片,按更新日期排序
response.write" </channel>"&chr(13)
function re(str)
if not isnull(str) then
re=replace(str,"&","&")
re=replace(re,"<","<")
re=replace(re,">",">")
re=replace(re,"'","'")
re=replace(re,"""",""")
end if
end function
function get_left(n,m)
n=cint(n):m=cint(m)
if m=1 then
mm=" order by zt_hits desc" '按点击量排序
else
mm=" order by zt_date desc" '按更新日期排序
end if
set rs1=conn.execute("select top "&n&" zt_id,zt_name,zt_zy,zt_dy,zt_type,zt_date,zt_hits,zt_content from zt_data"&mm)
get_left_i=0
do while not rs1.eof
get_left_i=get_left_i+1
get_left=get_left&" <item>"&chr(13)
get_left=get_left&" <title>"&re(rs1("zt_name"))&"</title>"&chr(13)
get_left=get_left&" <link>http://"&maxz_2&"/"&get_classenname(rs1("zt_type"))&"/"&rs1("zt_id")&"</link>"&chr(13)
get_left=get_left&" <description><![cdata[<p>类别:<a href=""http://"&maxz_2&"/"&get_classenname(rs1("zt_type"))&""">"&get_classname(rs1("zt_type"))&"</a></p><p>主演:"&rs1("zt_zy")&"</p><p>剧情:"&re(rs1("zt_content"))&"</p>]]></description>"&chr(13)
get_left=get_left&" <guid>http://"&maxz_2&"/"&get_classenname(rs1("zt_type"))&"/"&rs1("zt_id")&"</guid>"&chr(13)
get_left=get_left&" <category><![cdata["&get_classname(rs1("zt_type"))&"]]></category>"&chr(13)
get_left=get_left&" <pubdate>"&datetorfc822(rs1("zt_date"))&"</pubdate>"&chr(13)
get_left=get_left&" </item>"&chr(13)
if get_left_i>=n then exit do
rs1.movenext
loop
rs1.close
end function
function datetorfc822(byval dtaval)
dim strcurlocale : strcurlocale = getlocale()
setlocale("en-gb")
dtaval = cdate(dtaval)
datetorfc822 = weekdayname(weekday(dtaval),true)&", "& _
right("0"&day(dtaval),2)&" "& _
monthname(month(dtaval),true)&" "& _
year(dtaval)&" "& _
right("0"&hour(dtaval),2)&":"& _
right("0"&minute(dtaval),2)&":"& _
right("0"&second(dtaval),2)&" "& _
www~chinaz~com
"+0800"
setlocale(strcurlocale)
end function
%></rss>
演示:http://www.366mv.cn
代码如下,请根据注释修改相应的信息,版权信息还望各位能够保留 ^_^
复制代码 代码如下:
<%@language="vbscript" codepage="65001"%>
<%
session.codepage=65001
response.charset="utf-8"
'========================================================================
'copyright (c) 2005-2007, 酸溜溜影视([url]www.366mv.cn[/url]) all rights reserved.
'========================================================================
'名称: rss.asp
'描述: 动态生成rss feed。
'========================================================================
%>
<!--#include file=inc/conn.asp--><?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/atom">
<%
title="酸溜溜影视" '改成你自己的名称
response.write" <channel>"&chr(13)
response.write"<atom:link href=""http://"&maxz_2&"/xml.asp"" rel=""self"" type=""application/rss+xml"" />"&chr(13)
response.write" <title>最近更新影片 - "&title&"</title>"&chr(13)
response.write" <link>http://"&maxz_2&"</link>"&chr(13)
response.write" <description>"&title&" - 万部影片在线观看。免费电影,在线电影,tvb,日剧,韩剧,动漫,科幻,恐怖,言情,连续剧,大片,贺岁片……</description>"&chr(13)
response.write get_left(15,0) '显示前15部影片,按更新日期排序
response.write" </channel>"&chr(13)
function re(str)
if not isnull(str) then
re=replace(str,"&","&")
re=replace(re,"<","<")
re=replace(re,">",">")
re=replace(re,"'","'")
re=replace(re,"""",""")
end if
end function
function get_left(n,m)
n=cint(n):m=cint(m)
if m=1 then
mm=" order by zt_hits desc" '按点击量排序
else
mm=" order by zt_date desc" '按更新日期排序
end if
set rs1=conn.execute("select top "&n&" zt_id,zt_name,zt_zy,zt_dy,zt_type,zt_date,zt_hits,zt_content from zt_data"&mm)
get_left_i=0
do while not rs1.eof
get_left_i=get_left_i+1
get_left=get_left&" <item>"&chr(13)
get_left=get_left&" <title>"&re(rs1("zt_name"))&"</title>"&chr(13)
get_left=get_left&" <link>http://"&maxz_2&"/"&get_classenname(rs1("zt_type"))&"/"&rs1("zt_id")&"</link>"&chr(13)
get_left=get_left&" <description><![cdata[<p>类别:<a href=""http://"&maxz_2&"/"&get_classenname(rs1("zt_type"))&""">"&get_classname(rs1("zt_type"))&"</a></p><p>主演:"&rs1("zt_zy")&"</p><p>剧情:"&re(rs1("zt_content"))&"</p>]]></description>"&chr(13)
get_left=get_left&" <guid>http://"&maxz_2&"/"&get_classenname(rs1("zt_type"))&"/"&rs1("zt_id")&"</guid>"&chr(13)
get_left=get_left&" <category><![cdata["&get_classname(rs1("zt_type"))&"]]></category>"&chr(13)
get_left=get_left&" <pubdate>"&datetorfc822(rs1("zt_date"))&"</pubdate>"&chr(13)
get_left=get_left&" </item>"&chr(13)
if get_left_i>=n then exit do
rs1.movenext
loop
rs1.close
end function
function datetorfc822(byval dtaval)
dim strcurlocale : strcurlocale = getlocale()
setlocale("en-gb")
dtaval = cdate(dtaval)
datetorfc822 = weekdayname(weekday(dtaval),true)&", "& _
right("0"&day(dtaval),2)&" "& _
monthname(month(dtaval),true)&" "& _
year(dtaval)&" "& _
right("0"&hour(dtaval),2)&":"& _
right("0"&minute(dtaval),2)&":"& _
right("0"&second(dtaval),2)&" "& _
www~chinaz~com
"+0800"
setlocale(strcurlocale)
end function
%></rss>