ΪÂí¿Ë˹µçӰվдÁ˸öÉú³ÉRss FeedµÄ³ÌÐò£¨Ô­´´´úÂ룩

November 20, 2008 - 1:35 pm

ǰ¶Îʱ¼äΪÁ˸ø±¾È˵ĵçÓ°Õ¾Ôö¼ÓRss¶©ÔŦÄÜ£¬¶¯ÊÖдÁ˸ö¶¯Ì¬Éú³ÉRss FeedµÄASP´úÂ룬û·¨ÉÏ´«¸½¼þ£¬¾ÍÖ±½ÓÌù´úÂë°É£¬·´ÕýÒ²²»³¤£¬ÓÃÂí¿Ë˹×öµçÓ°Õ¾µÄÅóÓÑÖ±½ÓÄÃÈ¥Óðɣ¬ÆäËüÀàÐ͵ÄÕ¾µãÐÞ¸ÄÒ»ÏÂÒ²ÄÜÓá£Éú³ÉµÄRss Feed²ÉÓÃUTF-8±àÂ룬¾­¹ýfeedvalidator.orgУÑ飬¼æÈÝRss 2.0ºÍAtom¡£

ʹÓ÷½·¨£º½«ÏÂÃæµÄ´úÂë´æÎªrss.asp²¢ÉÏ´«µ½ÍøÕ¾¸ùĿ¼£¬Ê£ÏµĹ¤×÷¾ÍÊÇÕÒRssÌá½»Èë¿ÚÈ¥Ìá½»ÄãµÄFeedµØÖ·http://ÄãµÄÓòÃû/rss.asp

ÑÝʾ£ºhttp://www.366mv.cn

´úÂëÈçÏ£¬Çë¸ù¾Ý×¢ÊÍÐÞ¸ÄÏàÓ¦µÄÐÅÏ¢£¬°æÈ¨ÐÅÏ¢»¹Íû¸÷λÄܹ»±£Áô ^_^

 

ÒÔÏÂΪÒýÓõÄÄÚÈÝ£º
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Session.CodePage=65001
Response.Charset="UTF-8"
'========================================================================
'Copyright (c) 2005-2007, ËáÁïÁïÓ°ÊÓ£¨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"" _fcksavedurl="""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,"&","&amp;")
  re=Replace(re,"<","<")
  re=Replace(re,">",">")
  re=Replace(re,"'","&apos;")
  re=Replace(re,"""","&quot;")
 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)&" "& _
    "+0800"
 SetLocale(strCurLocale)
End Function
%></rss>