Class.asp
上传用户:rblchem
上传日期:2022-04-27
资源大小:1941k
文件大小:22k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. <script language="JavaScript" runat="server">
  2. function rfc_to_iso(DataRCC){
  3. var dateTimeObject = new Date(DataRCC);
  4. if(isNaN(dateTimeObject)){
  5.    var dateTimeObject2 = new Date(DataRCC.substring(0,DataRCC.lastIndexOf(" ")));
  6.    if (isNaN(dateTimeObject2)){
  7.            return DataRCC;
  8.    }
  9.    else{
  10.    return dateTimeObject2.toLocaleString();
  11.            }    
  12. }
  13. else{
  14. return dateTimeObject.toLocaleString();
  15. }
  16. }
  17. </script>
  18. <%
  19. Class TCategory
  20. Public ID
  21. Public Name
  22. Public Intro
  23. Public Order
  24. Public Count
  25. Public ParentID
  26. Public sortPath
  27. Public Function Post()
  28. Call CheckParameter(ID,"int",0)
  29. Call CheckParameter(Order,"int",0)
  30. 'ID可以为0
  31. Name=FilterSQL(Name)
  32. Intro=FilterSQL(Intro)
  33. If Len(Name)=0 Then Post=False:Exit Function
  34. If ID=0 Then
  35.     '这句话很有用捉摸一下
  36. conn.Execute("INSERT INTO [Category]([Category_Name],[Category_Order],[Category_Intro],[Category_ParentID],[Category_sortPath]) VALUES ('"&Name&"',"&Order&",'"&Intro&"','"&ParentID&"','"&sortPath&"')")
  37. Else
  38. conn.Execute("UPDATE [Category] set [Category_Name]='"&Name&"',[Category_Order]="&Order&",[Category_Intro]='"&Intro&"',[Category_ParentID]='"&ParentID&"',[Category_sortPath]='"&sortPath&"' WHERE [Category_ID] =" & ID)
  39. End If
  40. Post=True
  41. End Function
  42. Public Function LoadInfoByID(cate_ID)
  43. Call CheckParameter(cate_ID,"int",0)
  44. Set rs=conn.Execute("SELECT * FROM [Category] WHERE [Category_ID]=" & cate_ID)
  45. If (Not rs.bof) And (Not rs.eof) Then
  46. ID=rs("Category_ID")
  47. Name=rs("Category_Name")
  48. Intro=rs("Category_Intro")
  49. Order=rs("Category_Order")
  50. Count=rs("Category_Count")
  51. ParentID=rs("Category_parentID")
  52. sortPath=rs("Category_sortPath")
  53. Else
  54. Exit Function
  55. End If
  56. rs.Close
  57. Set rs=Nothing
  58. LoadInfoByID=True
  59. End Function
  60. Public Function Del()
  61. Call CheckParameter(ID,"int",0)
  62. If (ID=0) Then Del=False:Exit Function
  63. set rs=conn.execute ("select * from [Category] WHERE [Category_ParentID] =" & ID)
  64. If rs.bof Then
  65. conn.Execute("DELETE FROM [LinkXML] WHERE [Category_id]=" & ID)
  66. Conn.Execute("DELETE FROM [Article] WHERE [Category_id]=" & ID)
  67. Conn.Execute("DELETE FROM [Category] WHERE [Category_ParentID] =" & ID)
  68. Conn.Execute("DELETE FROM [Category] WHERE [Category_ID] =" & ID)
  69. Del=True
  70. Else
  71.     Del=False
  72.     End If
  73. End Function
  74. End Class
  75. Class TWebSite
  76. Public ID,Name,CateID,Intro,Url,XML,XmlUrl,Interval,AggregateNumber,Cate,ShenHe,strXmlFile,objXmlFile,Regexp_Description,DescriptionNumber,Regexp_Title,Regexp_Author,ViewOther
  77. Public documentElement,item,title,AuthorType,Author,AuthorText,AuthorText2,pubDate,pubDateTextOriginal,pubDateText,linka,Description,pubDateType,RegExpPattern,RegExpReplace,RegExpText,Elements,Report
  78. Public Function Post()
  79.     If not isobject(conn) then set conn=connectdb
  80.         On Error Resume Next
  81. 'ID可以为0
  82. Call CheckParameter(ID,"int",0)
  83. '这句话必须,如果ID空则插入
  84. Call CheckParameter(CateID,"int",0)
  85. Call CheckParameter(Interval,"int",0)
  86. Name=FilterSQL2(Name)
  87. Intro=FilterSQL2(Intro)
  88. Url=FilterSQL2(Url)
  89. XmlUrl=FilterSQL2(XmlUrl)
  90. Elements=Elements
  91. If Len(Name)=0 Then Post=False:Exit Function
  92. If ID=0 Then
  93. Conn.Execute("INSERT INTO [LinkXML]([title],[Category_id],[Description],[htmlUrl],[linkxml],[shenhe],[Inteval],[AggregateNumber],[Elements],[Other]) VALUES ('"&Name&"',"&CateID&",'"&Intro&"','"&Url&"','"&XmlUrl&"','"&ShenHe&"',"&Interval&","&AggregateNumber&",'"&Elements&"','"&ViewOther&"')")
  94. Else
  95. Conn.Execute("UPDATE [LinkXML] set [title]='"&Name&"',[Category_id]="&CateID&",[Description]='"&Intro&"',[htmlUrl]='"&Url&"',[linkxml]='"&XmlUrl&"',[shenhe]='"&shenhe&"',[Inteval]="&Interval&",[AggregateNumber]="&AggregateNumber&",[Elements]='"&Elements&"',[Other]='"&ViewOther&"' WHERE [id] =" & ID)
  96. Conn.Execute("UPDATE [Article] set [Category_id]="&CateID&" WHERE [xmlid]="&ID)
  97. End If
  98. If Err Then
  99. If err.number=-2147467259 Then
  100.             call Showerr_already
  101. err.clear
  102. Else
  103. call Showerr_unknown(err.number,err.description)
  104. err.clear
  105. End IF
  106. Post=False
  107. Else
  108.     Post=True
  109. End IF
  110. End Function
  111. Public Function LoadSiteInfoByID(site_ID)
  112.     If Not IsObject(Conn) Then set conn=connectdb()
  113. Call CheckParameter(site_ID,"int",0)
  114. Dim objRS
  115. Set objRS=conn.Execute("SELECT * FROM [LinkXML] WHERE [id]=" & site_ID)
  116. If (Not objRS.bof) And (Not objRS.eof) Then
  117. ID=objRS("id")
  118. Name=objRS("title")
  119. CateID=objRS("Category_id")
  120. Intro=objRS("Description")
  121. Url=objRS("htmlUrl")
  122. XmlUrl=objRS("linkxml")
  123. AggregateNumber=objRS("AggregateNumber")
  124. Interval=objRS("Inteval")
  125. ShenHe=objRS("ShenHe")
  126. ViewOther=objRS("Other")
  127. If trim(objRS("Elements"))="" or isnull(objRS("Elements")) or Ubound(Split(objRS("Elements"),"|||"))<>14 then
  128.             Elements=Split("||||||||||||||||||||||||||||||||||||||||||","|||")
  129. else
  130. Elements=Split(objRS("Elements"),"|||")
  131. End IF
  132.             documentElement=Elements(0)
  133. title=Elements(1)
  134. AuthorType=Elements(2)
  135. Author=Elements(3)
  136. AuthorText=Elements(4)
  137. pubDate=Elements(5)
  138. pubDateType=Elements(6)
  139. RegExpPattern=Elements(7)
  140. RegExpReplace=Elements(8)
  141. linka=Elements(9)
  142. Description=Elements(10)
  143. Regexp_Description=Elements(11)
  144.             DescriptionNumber=Elements(12)
  145. Regexp_Title=Elements(13)
  146. Regexp_Author=Elements(14)
  147. Else
  148.       
  149. Exit Function
  150. End If
  151. objRS.Close
  152. Set objRS=Nothing
  153. LoadSiteInfoByID=True
  154. End Function
  155. Public Function Del()
  156. Call CheckParameter(ID,"int",0)
  157. If (ID=0) Then Del=False:Exit Function
  158. Conn.Execute("DELETE FROM [Article] WHERE [xmlid] =" & ID)
  159. Conn.Execute("DELETE FROM [LinkXML] WHERE [id] =" & ID)
  160. Del=True
  161. End Function
  162. Public Function IsViewN()
  163. Call CheckParameter(ID,"int",0)
  164. If (ID=0) Then IsViewN=False:Exit Function
  165. Conn.Execute("UPDATE [LinkXML] set [Other]='N' WHERE [id]="&ID)
  166. IsViewN=True
  167. End Function
  168. Public Function IsViewY()
  169. Call CheckParameter(ID,"int",0)
  170. If (ID=0) Then IsViewY=False:Exit Function
  171. Conn.Execute("UPDATE [LinkXML] set [Other]='Y' WHERE [id]="&ID)
  172. IsViewY=True
  173. End Function
  174. Private Function Showerr(msg1,msg2,msg3)
  175. Report=Report& "<tr><td width=""80%"">"&msg1&"</td><td width=""20%"">"&msg2&"</td></tr><tr><td colspan=""2"">"&msg3&"</td></tr>"
  176. End Function
  177. Private Function Showerr_http(XmlUrl,httpStatus)
  178. Report=Report& "<tr><td width=""80%"">"&XmlUrl&"</td><td width=""20%"">下载失败,描述如下</td></tr><tr><td colspan=""2"">"&Showerr_Desciption(httpStatus)&"</td></tr>"
  179. End Function
  180. Private Function Showerr_Desciption(ErrorID)
  181. Set conn=ConnectDB()
  182. Set RS=conn.execute ("select * from [ErrHandle] where [ErrorID]=" & ErrorID )
  183. If not rs.eof Then
  184. Showerr_Desciption=" 错误代码:"&RS(0)&",错误描述:"&RS(1)&"&nbsp;"&RS(2)
  185. Else
  186. Showerr_Desciption="错误库中没有关于代码为"&ErrorID&"的描述,请向<a href=""http://www.sxna.cn"" target=_blank>www.SXNA.cn</a>报告此问题"
  187. End IF
  188. rs.close:set rs=nothing
  189. CloseDB(conn)
  190. End Function
  191. Private Function Showerr_unknown(err_number,err_description)
  192. Report=Report& "<tr><td width=""80%"">发生未知错误,请向<a href=""http://www.sxna.cn"" target=_blank>www.sxna.cn</a>报告此错误</td><td width=""20%"">描述如下</td></tr><tr><td colspan=""2"">错误代码:"&err_number&",错误描述:"&err_description&"</td></tr>"
  193. End Function
  194. Private Function Showerr_already()
  195. Report=Report&  "<tr><td width=""80%"">这个地址您已经加入了</td><td width=""20%"">地址重复</td></tr><tr><td colspan=""2""><span style=""cursor:hand;color:#FF6600;""><a href=""admin_xml.asp"">按这里请重新输入</a></span></td></tr>"
  196. End Function
  197. Private Function Showerr_NOTXML(XmlUrl,xml_parseError_errorCode)
  198. Report=Report& "<tr><td width=""80%"">"&XmlUrl&"解析失败,不是标准XML文件</td><td width=""20%""></td></tr><tr><td colspan=""2"">错误代码:"&xml_parseError_errorCode&"<span style=""cursor:hand;color:#FF6600;"" onclick=""javascript:history.go(-1);"">请重新输入</span>,若仍失败请向<a href=""http://www.sxna.cn"" target=_blank>www.sxna.cn</a>报告</td></tr>"
  199. End Function
  200. Private Function ShowErr2(XmlUrl,Name)
  201. Report=Report& "<tr><td width=""80%"">"&XmlUrl&"</td><td width=""20%"">加入失败</td></tr><tr><td colspan=""2"">该文件<b>"&Name&"</b>部分有错误。<span style=""cursor:hand;color:#FF6600;"" onclick=""javascript:history.go(-1);"">请重新输入</span>,若仍失败请向<a href=""http://www.sxna.cn"" target=_blank>www.sxna.cn</a>报告</td></tr>"
  202. End Function
  203. Public Function GetXml
  204.         on error resume next
  205.             Dim objXMLHTTP
  206. Set objXMLHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")
  207. objXMLHTTP.setTimeouts lResolve*1000,lConnect*1000,lSend*1000,lReceive*1000
  208. objXMLHTTP.Open "GET",XmlUrl,False
  209. objXMLHTTP.Send
  210. Select Case ObjXMLHTTP.readyState
  211. Case 0
  212. call Showerr("对象初始化失败,估计你输入了一堆无效的字符....","请检查一下~","错误参数:"&Err.Number&Err.Description)
  213. GetXml=False
  214. Case 1
  215. call Showerr(XmlUrl&"域名分析超时/连接站点超时!也许是这个网站有问题,或许是超时设定太短,或许机器没有联网","请检查","错误参数:"&Err.Number&Err.Description)
  216. GetXml=False
  217. Case 2
  218. call Showerr(XmlUrl&"发送数据请求超时,是不是服务器出故障了?","请检查","错误参数:"&Err.Number&Err.Description)
  219. GetXml=False
  220. Case 3
  221. ContentLength=objXMLHTTP.GetResponseHeader("Content-Length")
  222. If err.number=-2147012746 then
  223. Call Showerr(XmlUrl&"数据下载超时/等待反馈时间超时","原因如下","没有获得文件大小的信息,估计网站有问题,可能是你的等待反馈时间超时设定太短")
  224. Else
  225. Call Showerr(RSSLINK_S&"数据下载超时/等待反馈时间超时","原因如下","该文件大小"&Formatnumber(ContentLength/1000,2)&"KB,下载过程中超过你设定的等待反馈时间超时时间,可能是你的等待反馈时间超时设定太短了,或许这个网站他就是慢...")
  226. End If
  227. Err.clear
  228. GetXml=False
  229. Case 4
  230. ContentLength=objXMLHTTP.GetResponseHeader("Content-Length")
  231. If err.number=-2147012746 then
  232. If objXMLHTTP.Status=200 Then
  233. call Showerr(XmlUrl&"没有找到文件长度信息,估计是这个网站的rss设计有问题","","操作继续..附加头信息供调试"&objXMLHTTP.GetAllResponseHeaders)
  234. strXmlFile=objXMLHTTP.responseBody
  235. GetXml=True
  236. Else
  237. call Showerr_http(XmlUrl,objXMLHTTP.status)
  238. GetXml=False
  239. End If 
  240. err.clear
  241. ElseIf err.number<>0 then
  242. call Showerr(XmlUrl&"有未知错误发生","有错误","错误参数:"&Err.Number&Err.Description)
  243. GetXml=False
  244. err.clear
  245. Else
  246. If objXMLHTTP.Status=200 Then
  247. strXmlFile=objXMLHTTP.responseBody
  248. GetXml=True
  249. Else
  250. call Showerr_http(XmlUrl,objXMLHTTP.status)
  251. GetXml=False
  252. End If
  253. End If
  254. End Select
  255. End Function
  256.    Public Function GetXml2
  257.         ON ERROR RESUME NEXT
  258. Set objXMLHTTP=Server.CreateObject("Microsoft.XMLHTTP")
  259. objXMLHTTP.Open "GET",XmlUrl,False
  260. objXMLHTTP.Send
  261. If objXMLHTTP.Status="200" Then
  262. strXmlFile=objXMLHTTP.responseBody
  263. GetXml2=True
  264. Else
  265. call Showerr_http(XmlUrl,objXMLHTTP.status)
  266. GetXml2=False
  267. Exit Function
  268. End If
  269. If Err Then
  270. call Showerr(Err.description,"","")
  271. Err.clear
  272. GetXml2=False
  273. Exit Function
  274. End IF
  275. End Function
  276. Private Function StrangeTOISO(DataRCC)
  277. StrangeTOISO=ReplaceStr(DataRCC,"(?:D*)(d+)D(d+)D(d+)D(d+)D(d+)D(d+)(?:.*)","$1-$2-$3 $4:$5:$6")
  278. End function
  279. Public Function ParseXml()
  280. Set xml=Server.CreateObject("Microsoft.XMLDOM")
  281. xml.Async=False
  282. xml.ValidateOnParse=False
  283. xml.Load(strXmlFile)
  284. If xml.ReadyState=4 Then
  285. If xml.parseError.errorCode <> 0 Then
  286.         call Showerr_NOTXML(XmlUrl,xml.parseError.errorCode)
  287. ParseXml=False
  288. set xml=nothing
  289. Exit Function
  290. Else
  291.   Set Gen=xml.documentElement
  292.    If Gen is Nothing Then 
  293.    call Showerr_NOTXML(XmlUrl,xml.parseError.errorCode)
  294.    ParseXml=False
  295.    set xml=nothing
  296.    Exit Function
  297.    End If 
  298.  
  299. Set channel=xml.documentElement.selectSingleNode("channel")
  300. If channel is Nothing then
  301.   Set feed=xml.getElementsByTagName("feed")
  302.   set feed=feed(0)
  303.   'ATom
  304.    If feed is Nothing then
  305.    Report=Report&"<tr><td width=""80%"">"&XmlUrl&"不是RSS/ATOM文件</td><td width=""20%""></td></tr><tr><td colspan=""2"">请察看原因</td></tr>"
  306.    ParseXml=False
  307.    set xml=nothing
  308.    Exit Function
  309.    Else
  310.    'FEED分析
  311.    On error resume next
  312.    documentElement="ATOM"
  313.    Url=feed.selectSingleNode("link").getAttributeNode("href").value
  314.    Name=feed.selectSingleNode("title").text
  315.    If Name="" Then Name="未知"
  316.    Intro=feed.selectSingleNode("subtitle").text
  317.    
  318. set item=xml.getElementsByTagName("entry")
  319. Set objtitle=item(0).selectSingleNode("title")
  320. If objtitle is Nothing then 
  321. title=""
  322.   Else
  323. title="title"
  324. End If
  325. Redim NodeAuthor(2)
  326. NodeAuthor(1)="author|item|Multi"
  327. NodeAuthor(2)="author|feed|Single"
  328. For i=1 to Ubound(NodeAuthor)
  329.     If split(NodeAuthor(i),"|")(1)="item" then Set objAuthor=item(0).selectSingleNode(split(NodeAuthor(i),"|")(0))
  330. If split(NodeAuthor(i),"|")(1)="feed" then Set objAuthor=feed.selectSingleNode(split(NodeAuthor(i),"|")(0))
  331. If objAuthor is Nothing then
  332.   If i=Ubound(NodeAuthor) then
  333.   AuthorType="Single"
  334.   Author=""
  335.   AuthorText=feed.selectSingleNode("title").text  
  336.   Exit for
  337.   Else
  338.   End If
  339. Else
  340. Set objname=objAuthor.selectSingleNode("name")
  341.    If objname is Nothing then
  342. AuthorType="Single"
  343. Author=""
  344. AuthorText=feed.selectSingleNode("title").text
  345. Else
  346. AuthorType=split(NodeAuthor(i),"|")(2)
  347. Author="name"
  348. AuthorText=objname.text
  349. End If
  350. Exit For
  351. End If
  352. Next
  353. AuthorText2=AuthorText
  354. AuthorText=PickUpTrueAuthor(AuthorText)
  355. Redim NodepubDate(2)
  356. NodepubDate(1)="updated"
  357. NodepubDate(2)="modified"
  358. For i=1 to Ubound(NodepubDate)
  359. Set objpubDate=item(0).selectSingleNode(NodepubDate(i))
  360. If objpubDate is Nothing then
  361.   If i=Ubound(NodepubDate) then
  362.   pubDate="No"
  363. Exit for
  364.   Else
  365.   End If
  366. Else
  367. pubDate=NodepubDate(i)
  368. RegexpDate(objpubDate)    
  369. pubDateTextOriginal= objpubDate.text
  370. RegExpPattern=""
  371. RegExpReplace=""
  372. Exit For
  373. End If
  374. Next
  375. If NOT ISDATE(pubDateText) Then
  376.                 pubDateType="Type3"
  377. End IF
  378.  Set objlink=item(0).selectSingleNode("link")
  379.    If objlink is Nothing then 
  380.    linka=""
  381. Else
  382.    linka="link"
  383. End If
  384.  Set objDescription=item(0).selectSingleNode("summary")
  385. If objDescription is Nothing then
  386.    set objDescription=item(0).selectSingleNode("content")
  387.    If objDescription is Nothing then
  388.    Description="title"
  389.    Else
  390.        Description="content"
  391.    End If
  392. Else
  393. Description="summary"
  394. End If
  395.                            AggregateNumber=item.Length
  396.    Regexp_Description="0"
  397.    Regexp_Author="0"
  398.    Regexp_Title="0"
  399.                            DescriptionNumber=""
  400.    ParseXml=True
  401.    End IF'ATOM分析结束
  402. Else
  403.   'RSS分析开始
  404.   On error resume next
  405.  
  406.                   documentElement="RSS"
  407.   Url=channel.selectSingleNode("link").text
  408.   Name=channel.selectSingleNode("title").text
  409.   If Name="" Then Name="未知"
  410.   Intro=channel.selectSingleNode("description").text
  411.                   
  412.   Set item=xml.getElementsByTagName("item")
  413.                   Set item=item(0)
  414.   Set objtitle=item.selectSingleNode("title")
  415. If objtitle is Nothing then 
  416.    title=""
  417. Else
  418.    title="title"
  419. End If
  420. Redim NodeAuthor(4)
  421. NodeAuthor(1)="author|item|Multi"
  422. NodeAuthor(2)="dc:creator|item|Multi"
  423. NodeAuthor(3)="dc:creator|channel|Single"
  424. NodeAuthor(4)="source|channel|Single"
  425. For i=1 to Ubound(NodeAuthor)
  426. SplitedNodeAuthor=split(NodeAuthor(i),"|")
  427. If SplitedNodeAuthor(1)="item" then Set objAuthor=item.selectSingleNode(SplitedNodeAuthor(0))
  428. If SplitedNodeAuthor(1)="channel" then Set objAuthor=channel.selectSingleNode(SplitedNodeAuthor(0))
  429. If objAuthor is Nothing then
  430.   If i=Ubound(NodeAuthor) then
  431.    IF RegExpTest("msn.com",XmlUrl) then
  432.   AuthorType="Single"
  433.   Author=""
  434.   AuthorText=split(XmlUrl,"/")(4)
  435.    ElseIf RegExpTest("yculblog.com",XmlUrl) then
  436.    AuthorType="Single"
  437.    Author=""
  438.    AuthorText=split(split(XmlUrl,"/")(2),".")(0)
  439.    Else
  440. Set objAuthor=channel.selectSingleNode("webMaster")
  441.    If objAuthor is Nothing then
  442. AuthorType="Single"
  443. Author=""
  444. AuthorText=xml.documentElement.selectSingleNode("channel").selectSingleNode("title").text
  445. Else
  446. AuthorType="Single"
  447. Author=""
  448. AuthorText=objAuthor.text
  449. End IF
  450.   Exit for
  451.   End If
  452.  End If
  453. Else
  454. AuthorType=SplitedNodeAuthor(2)
  455. Author=SplitedNodeAuthor(0)
  456. AuthorText=objAuthor.text
  457. Exit For
  458. End If
  459. Next
  460. AuthorText2=AuthorText
  461.             AuthorText=PickUpTrueAuthor(AuthorText)
  462.             
  463.             Redim NodepubDate(5)
  464. NodepubDate(1)="pubDate"
  465. NodepubDate(2)="dc:date"
  466. NodepubDate(3)="PubDate"
  467. NodepubDate(4)="pubdate"
  468. NodepubDate(5)="Pubdate"
  469. For i=1 to Ubound(NodepubDate)
  470. Set objpubDate=item.selectSingleNode(NodepubDate(i))
  471. If objpubDate is Nothing then
  472.   If i=Ubound(NodepubDate) then
  473.                   pubDate="No"
  474.     Exit for
  475.   Else
  476.   End If
  477. Else
  478. pubDate=NodepubDate(i)
  479. RegexpDate(objpubDate)    
  480. pubDateTextOriginal= objpubDate.text
  481. RegExpPattern=""
  482.     RegExpReplace=""
  483. Exit For
  484. End If
  485. Next
  486. If NOT ISDATE(pubDateText) Then
  487.  pubDateType="Type3"
  488.  If RegExpTest("pconline.com.cn",XmlUrl) Then 
  489.   pubDate="pubDate"
  490.   RegExpPattern=".0"
  491.   RegExpReplace=""
  492.  End If         
  493.  If RegExpTest("tianyablog.com",XmlUrl) Then 
  494.   pubDate="comments"
  495.   pubDateType="Type1"
  496.   pubDateTextOriginal=item.selectSingleNode(pubDate).text
  497.   pubDateText=StrangeTOISO(pubDateTextOriginal)
  498.   RegExpPattern=""
  499.   RegExpReplace=""
  500.  End If 
  501. End IF
  502.    Set objlink=item.selectSingleNode("link")
  503. If objlink is Nothing then 
  504.    linka=""
  505. Else
  506.    linka="link"
  507. End If
  508.    Set objDescription=item.selectSingleNode("description")
  509. If objDescription is Nothing then
  510.    Description="title"
  511. Else
  512.    Description="description"
  513. End If
  514.   Set Objitemnodes=Xml.Getelementsbytagname("item")
  515. Aggregatenumber=Objitemnodes.Length
  516.                     Regexp_Description="0"
  517.     Regexp_Author="0"
  518.     Regexp_Title="0"
  519.                     DescriptionNumber=""
  520.   ParseXml=True
  521. End IF
  522. End IF 'xml.parseError.errorCode <> 0
  523. End If'xml.ReadyState=4
  524. End Function
  525. Private Function PickUpTrueAuthor(Text)
  526.       IF RegExpTest("(.+)",Text) then
  527.         Set SRegExp=New RegExp
  528. SRegExp.IgnoreCase =True
  529. SRegExp.Global=True
  530. SRegExp.Pattern="(.+)"
  531. Set Match = SRegExp.Execute(Text)
  532. IF MATCH.COUNT<>0 THEN
  533. PickUpTrueAuthor=Match(0).value
  534.                     PickUpTrueAuthor=Replace(PickUpTrueAuthor,CHR(40),"")
  535.                     PickUpTrueAuthor=Replace(PickUpTrueAuthor,CHR(41),"")
  536. Else
  537. PickUpTrueAuthor=Text
  538. End IF
  539.                 Set SRegExp=Nothing
  540.   Else
  541.   PickUpTrueAuthor=Text
  542.   End IF
  543. End Function
  544. Private Function RegexpDate(objpubDate)
  545.    IF RegExpTest("(?:D*)(d+)D(d+)D(d+)D(d+)D(d+)D(d+)(?:.*)",objpubDate.text) then
  546.   pubDateText=StrangeTOISO(objpubDate.text)
  547.   If ISDATE(pubDateText) then pubDateType="Type1"
  548.    Else
  549.   pubDateText=rfc_to_iso(objpubDate.text)
  550.   If ISDATE(pubDateText) then pubDateType="Type2"
  551.    End IF
  552. End Function
  553. Public Function Add_xml()
  554.  
  555.     If IsUseXmlHttp=0 then
  556. If GetXml Then
  557. If ParseXml Then
  558. Add_xml=True
  559. Else
  560. Add_xml=False
  561. End If
  562. Else
  563. Add_xml=False
  564. End If
  565. Else
  566.     If GetXml2 Then
  567. If ParseXml Then
  568. Add_xml=True
  569. Else
  570. Add_xml=False
  571. End If
  572. Else
  573. Add_xml=False
  574. End If
  575. End If
  576. If trim(Report)<>"" then
  577. response.write Report
  578. Else
  579. response.write "<tr><td>下载成功</td></tr>"
  580.         End If
  581. session(SessionStr&"ReloadXMLReport")= session(SessionStr&"ReloadXMLReport") & Report
  582. End Function
  583. Private Sub Class_Initialize()
  584. End Sub
  585. End Class
  586. %>