I am trying to create an xml file made from various RSS feeds in order by most recent. I plan on accessing this master xml file to display 6 most recent blog entries. At the moment it's dynamic (an xslt reorders by date posted and displays only 6) but with 17 blogs being read it's slowing down the page that's loading them.
I would like to aggregate all 17 blogs to a single xml file and have a cron job run the asp file that generates the file. In a perfect world it would reorder them and display only 6.
Here is what I have for my dynamic feed written in classic ASP. How do I make it write to a file?
<%
Set xslDoc = Server.CreateObject("MSXML
2.DomDocum
ent.4.0")
xslDoc.async = false
xslDoc.load(Server.MapPath
("feedTran
sform.xslt
"))
Set xmlFeedlist = Server.CreateObject("MSXML
2.DomDocum
ent.4.0")
Set oRoot = xmlFeedlist.createElement(
"rss")
oRoot.setAttribute "version", "2.0"
xmlFeedlist.appendChild(oR
oot)
'load feed 1
Set xmlFeed1 = Server.CreateObject("MSXML
2.DomDocum
ent.4.0")
xmlFeed1.async = false
xmlFeed1.Load(getXmlFeed("
http://xx.com/index.xml"))
If Not xmlFeed1.documentElement Is Nothing Then
oRoot.appendChild(xmlFeed1
.documentE
lement.chi
ldNodes(0)
.cloneNode
(true))
End if
'load feed 2
Set xmlFeed2 = Server.CreateObject("MSXML
2.DomDocum
ent.4.0")
xmlFeed2.async = false
xmlFeed2.Load(getXmlFeed("
http://xx.com/index.xml"))
If Not xmlFeed2.documentElement Is Nothing Then
' We want the channel node, which is the child of the root element
oRoot.appendChild(xmlFeed2
.documentE
lement.chi
ldNodes(0)
.cloneNode
(true))
End if
function getXmlFeed(sUrl)
Dim oXMLHttp
Dim oADORec
Dim sXML
Set oXMLHttp = Server.CreateObject("Msxml
2.ServerXM
LHTTP.4.0"
)
oXMLHttp.open "GET", sUrl, false
oXMLHttp.send() ' Send the request.
getXmlFeed = oXMLHttp.ResponseBody
set oXMLHttp = nothing
End function
xmlFeedlist.transformNodeT
oObject xslDoc, response
Set oRoot = nothing
Set xslDoc = nothing
Set xmlFeedlist = nothing
Set xmlFeed1 = nothing
Set xmlFeed2 = nothing
function getXmlFeed(sUrl)
Dim oXMLHttp
Dim oADORec
Dim sXML
Set oXMLHttp = Server.CreateObject("Msxml
2.ServerXM
LHTTP.4.0"
)
oXMLHttp.open "GET", sUrl, false
oXMLHttp.send() ' Send the request.
getXmlFeed = oXMLHttp.ResponseBody
set oXMLHttp = nothing
End function
%>
thanks!
aenders
Start Free Trial