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