复制代码代码如下:
<%
'atom2rss.asp
'Author:FrancescoPassantino
'Email:[email protected]
'Blog:www.iteam5.net/blog
'Startdate:17Sep2004
Subatom2rss(URL)
SetobjXML=Server.CreateObject("msxml2.DOMDocument.3.0")
objXML.async=false
objXML.setProperty"ServerHTTPRequest",True
objXML.validateOnParse=true
objXML.preserveWhiteSpace=false
IfNotobjXML.Load(URL)Then
Response.write"<P>ERROR<br>code:"&_
objXML.parseError.errorCode&_
"<br>Linea/Col:"&_
objXML.parseError.line&"/"&_
objXML.parseError.linepos&"</P>"
Else
rsstitle="iteam5.net/blog"
rssdescription="Blogsullenovit?delsettoreInformation&CommunicationTechnologies"
rsslink="http://www.iteam5.net/blog"
rsslanguage="it"
xml="<?xmlversion=""1.0""encoding=""UTF-8""?><rssversion=""0.91""><channel><title>"&server.htmlencode(rsstitle)&"</title><description>"&server.htmlencode(rssdescription)&"</description><link>"&server.htmlencode(rsslink)&"</link><language>"&server.htmlencode(rsslanguage)&"</language>"
SetobjNodeList=objXML.getElementsByTagName("entry")
ForEachobjNodeInobjNodeList
ForEachobjNode2InobjNode.childNodes
SelectCaseobjNode2.nodeName
Case"issued"
strdate=left(objNode2.firstChild.nodevalue,10)
Case"link"
strURL=objNode2.GetAttribute("href")
Case"title"
strTitle=objNode2.firstChild.nodevalue
'insteadofCase"content"
Case"summary"
strDescription=objNode2.firstChild.data
ForEachobjNode3InobjNode2.childNodes
SelectCaseobjNode3.nodeName
Case"div"
StrDescription=objNode3.text
ForEachobjNode4InobjNode3.childNodes
SelectCaseobjNode4.nodeName
Case"a"