手机
当前位置:查字典教程网 >编程开发 >ASP教程 >可以应用到马克斯电影站生成Rss Feed的代码
可以应用到马克斯电影站生成Rss Feed的代码
摘要:使用方法:将下面的代码存为rss.asp(记得以UTF-8格式保存)并上传到网站根目录,剩下的工作就是找Rss提交入口去提交你的Feed地址...

使用方法:将下面的代码存为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])Allrightsreserved.

'========================================================================

'名称:rss.asp

'描述:动态生成RssFeed。

'========================================================================

%>

<><?xmlversion="1.0"encoding="utf-8"?>

<rssversion="2.0"xmlns:atom="http://www.w3.org/2005/Atom">

<%

title="酸溜溜影视"'改成你自己的名称

response.write"<channel>"&chr(13)

response.write"<atom:linkhref=""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.writeget_left(15,0)'显示前15部影片,按更新日期排序

response.write"</channel>"&chr(13)

Functionre(str)

IfNotIsNull(str)then

re=Replace(str,"&","&")

re=Replace(re,"<","<")

re=Replace(re,">",">")

re=Replace(re,"'","'")

re=Replace(re,"""",""")

Endif

EndFunction

Functionget_left(n,m)

n=CInt(n):m=CInt(m)

Ifm=1Then

mm="orderbyzt_hitsdesc"'按点击量排序

Else

mm="orderbyzt_datedesc"'按更新日期排序

EndIf

setrs1=conn.execute("selecttop"&n&"zt_id,zt_name,zt_zy,zt_dy,zt_type,zt_date,zt_hits,zt_contentfromzt_data"&mm)

get_left_i=0

Dowhilenotrs1.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>类别:<ahref=""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)

Ifget_left_i>=nThenExitDo

rs1.movenext

Loop

rs1.close

EndFunction

FunctionDateToRFC822(byValdtaVal)

DimstrCurLocale: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)

EndFunction

%></rss>

【可以应用到马克斯电影站生成Rss Feed的代码】相关文章:

一个可以自动创建多级目录的函数

ASP.NET共享ASP用户Session的方法及代码

很有用的学习ASP常用到的代码第1/2页

域名查询系统用到的类

用asp实现无组件生成验证码的方法2种

带数据库的ASP用户名密码登录验证代码

一段几乎可以让你死机的JS代码

ASP怎么谈到应用到类的?

在ASP中用组件检测当前网卡地址的代码

可以查询百度排名的asp源码放送了

精品推荐
分类导航