可以应用到马克斯电影站生成Rss Feed的代码

所属分类: 网络编程 / ASP编程 阅读数: 540
收藏 0 赞 0 分享
使用方法:将下面的代码存为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,"'","&apos;") 
  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>  

更多精彩内容其他人还在看

asp知识整理笔记4(问答模式)

这是关于asp知识整理的最后一份笔记,希望大家仔细阅读。
收藏 0 赞 0 分享

ASP基础知识VBScript基本元素讲解

这篇文章主要介绍了ASP基础知识VBScript基本元素的相关资料,需要的朋友可以参考下
收藏 0 赞 0 分享

ASP编码和解码函数详解

这篇文章主要介绍了ASP编码和解码函数的相关资料,需要的朋友可以参考下
收藏 0 赞 0 分享

ASP显示页面执行时间的方法

这篇文章主要介绍了ASP显示页面执行时间的方法,在本地测试一下输出页面需要多少时间,需要的朋友可以参考下
收藏 0 赞 0 分享

ASP基础入门第一篇(ASP技术简介)

本文将以 Active Server Pages 为中心,向你全面展示制作动态商业网站的步骤和技巧并通过大量的实例,让你在不断的理论和实践之中笑傲“网络”……
收藏 0 赞 0 分享

ASP基础入门第二篇(ASP基础知识)

这篇文章是ASP基础入门第二篇,第一篇展示了ASP动态网站设计的一些最基本的方法,相信通过实践各位对 ASP 已经有了最基本的了解,本文将进一步介绍ASP动态网站的一些基本技巧,需要的朋友可以参考下
收藏 0 赞 0 分享

ASP基础入门第三篇(ASP脚本基础)

通过前两篇的学习,相信各位已经对 ASP 的动态网站设计有了一个基本的概念和整体的印象。从本篇开始作者将从脚本语言的使用着手,由浅入深地带领大家探索 ASP 动态网站设计的真正奥秘。
收藏 0 赞 0 分享

ASP基础入门第四篇(脚本变量、函数、过程和条件语句)

大家在学习了脚本语言 VBScript 的变量、常量和过程的基本概念后,本期将继续向各位介绍 VBScript 的函数和语法。
收藏 0 赞 0 分享

ASP基础入门第五篇(ASP脚本循环语句)

在本文上两篇中,我们学习了脚本语言 VBScript 的变量、函数、过程和条件语句,本篇将继续给大家介绍 VBScipt 的循环语句,并对脚本语言在 ASP 中的应用加以总结。  
收藏 0 赞 0 分享

ASP基础入门第六篇(ASP内建对象Request)

从本篇开始作者从 ASP 内建对象着手,为大家详细剖析 ASP 的六个内建对象和各种组件的特性和方法,需要的朋友可以参考下
收藏 0 赞 0 分享
查看更多