troubleshooting Question

Aggregate numerous RSS feeds into a single xml file, reorder by most recent and display 6

Avatar of aenders
aenders asked on
Web Languages and StandardsASPXML
4 Comments1 Solution492 ViewsLast Modified:
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("MSXML2.DomDocument.4.0")
xslDoc.async = false
xslDoc.load(Server.MapPath("feedTransform.xslt"))

Set xmlFeedlist = Server.CreateObject("MSXML2.DomDocument.4.0")
Set oRoot = xmlFeedlist.createElement("rss")
oRoot.setAttribute "version", "2.0"
xmlFeedlist.appendChild(oRoot)

'load feed 1
Set xmlFeed1 = Server.CreateObject("MSXML2.DomDocument.4.0")
xmlFeed1.async = false
xmlFeed1.Load(getXmlFeed("http://xx.com/index.xml"))
If Not xmlFeed1.documentElement Is Nothing Then
     oRoot.appendChild(xmlFeed1.documentElement.childNodes(0).cloneNode(true))
End if


'load feed 2
Set xmlFeed2 = Server.CreateObject("MSXML2.DomDocument.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.documentElement.childNodes(0).cloneNode(true))
End if

function getXmlFeed(sUrl)

     Dim oXMLHttp
     Dim oADORec
     Dim sXML

      Set oXMLHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
      oXMLHttp.open "GET", sUrl, false
    oXMLHttp.send() ' Send the request.
      
      
      getXmlFeed = oXMLHttp.ResponseBody
      
      set oXMLHttp = nothing

End function

xmlFeedlist.transformNodeToObject 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("Msxml2.ServerXMLHTTP.4.0")
      oXMLHttp.open "GET", sUrl, false
    oXMLHttp.send() ' Send the request.
      
      
      getXmlFeed = oXMLHttp.ResponseBody
      
      set oXMLHttp = nothing

End function

%>

thanks!
aenders
ASKER CERTIFIED SOLUTION
jawahar_prasad

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros