Copy codeThe Code is as follows: <%
'Atom2rss. asp
'Author: Francesco Passantino
'Email: francesco@iteam5.net
'Blog: www.iteam5.net/blog
'Start date: 17 Sep 2004
Sub atom2rss (URL)
Set objXML = Server. CreateObject ("msxml2.DOMDocument. 3.0 ")
ObjXML. async = false
ObjXML. setProperty "ServerHTTPRequest", True
ObjXML. validateOnParse = true
ObjXML. preserveWhiteSpace = false
If Not objXML. 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 = "Blog sulle novit? Del settore Information & Communication Technologies"
Rsslink = "http://www.iteam5.net/blog"
Rsslanguage = "it"
Xml = "<? Xml version = "" 1.0 "" encoding = "" UTF-8 ""?> <Rss version = "0.91" "> <channel> <title>" &server.html encode (rsstitle) & "</title> <description>" &server.html encode (rssdescription) & "</description> <link>" &server.html encode (rsslink) & "</link> <language>" &server.html encode (rsslanguage) & "</language>"
Set objNodeList = objXML. getElementsByTagName ("entry ")
For Each objNode In objNodeList
For Each objNode2 In objNode. childNodes
Select Case objNode2.nodeName
Case "issued"
Strdate = left (objNode2.firstChild. nodevalue, 10)
Case "link"
StrURL = objNode2.GetAttribute ("href ")
Case "title"
StrTitle = objNode2.firstChild. nodevalue
'Instead of Case "content"
Case "summary"
StrDescription = objNode2.firstChild. data
For Each objNode3 In objNode2.childNodes
Select Case objNode3.nodeName
Case "div"
StrDescription = objNode3.text
For Each objNode4 In objNode3.childNodes
Select Case objNode4.nodeName
Case ""
Linkable = objNode4.firstChild. text
Htmlink = "<a href = '"&_
ObjNode4.GetAttribute ("href") & "'> "&_
Linkable & "</a>"
StrDescription = replace (StrDescription, linkable, htmlink)
End select
Next
End select
Next
End Select
Next
Xml = xml & "<item>"
Xml = xml & "<title> <! [CDATA ["& server.html encode (strTitle) &"]> </title>"
Xml = xml & "<description> <! [CDATA ["& server.html encode (strDescription) &"]> </description>"
Xml = xml & "<link> <! [CDATA ["& server.html encode (strURL) &"]> </link> </item>"
StrTitle = ""
StrURL = ""
StrDescription = ""
Next
Xml = xml & "</channel> </rss>"
Response. ContentType = "text/xml"
Response. write xml
Set objNodeList = Nothing
End if
End sub
Call atom2rss ("http://www.iteam5.net/blog/feed.xml ")
%>