可以应用到马克斯电影站生成Rss Feed的代码
2008-03-18 00:00
525 查看
使用方法:将下面的代码存为rss.asp(记得以UTF-8格式保存)并上传到网站根目录,剩下的工作就是找Rss提交入口去提交你的Feed地址http://你的域名/rss.asp
演示:http://http://www.jb51.net/article/www.366mv.cn
代码如下,请根据注释修改相应的信息,版权信息还望各位能够保留 ^_^
演示:http://http://www.jb51.net/article/www.366mv.cn
代码如下,请根据注释修改相应的信息,版权信息还望各位能够保留 ^_^
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Session.CodePage=65001 Response.Charset="UTF-8" '======================================================================== 'Copyright (c) 2005-2007, 酸溜溜影视(http://www.jb51.net/article/www.366mv.cn) 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>
相关文章推荐
- 可以应用到马克斯电影站生成Rss Feed的代码
- Unity基于模板生成代码的原理与应用
- gsoap应用---利用gsoap工具生成代码
- java应用maven插件动态生成webservice代码
- 最近在研究enigma2的代码,那叫个庞大,C/C++写中间件,上层应用全部用python实现,可以学习一下plugin的实现机制了.
- PHP5.0 代码:用 DomDocument 对象生成 RSS 文档
- Java代码生成利器之rapid-generate应用三
- Web API应用架构在Winform混合框架中的应用(4)--利用代码生成工具快速开发整套应用
- 应用开发平台与代码生成工具感想
- QStringLiteral(源代码里有一个通过构造函数产生的从const char*到QString的隐式转换,QStringLiteral字符串可以放在代码的任何地方,编译期直接生成utf16字符串,速度很快,体积变大)
- Android零基础入门第9节:Android应用实战,不懂代码也可以开发
- Wix#可以直接写C#代码来生成Wix的MSI安装文
- MATLAB Coder可以从MATLAB代码生成独立的、可读性强、可移植的C/C++代码
- T4模版在代码生成中的应用心得
- 实用工具,可以生成dal层的相关cs代码
- Javascript生成json的函数代码(可以用php的json_decode解码)
- Ibatis代码自动生成工具——Abator安装与应用实例(图解)
- 【matlab应用】:生成老电影海报
- 讨厌下载电影和电视剧文件名中的多余字符(如网址和广告字样),搞得文件名好长,可以使用下面的Python代码