Read and display RSS feeds in classic ASP
User Rating: / 5
PoorBest 
Written by Loginworks Team   
Tuesday, 22 June 2010 10:43

Below you will see how you can read data from a RSS feed using classic asp and XmlHTTP object and then display the results the way you want to do.

Sub getRSS(NoOfResult,RssURL)

Set xmlHttp = Server.CreateObject("MSXML2.XMLHTTP.4.0")
xmlHttp.Open "Get", RssURL, false
xmlHttp.Send()
myXML = xmlHttp.ResponseText

Set xmlResponse = Server.CreateObject("MSXML2.DomDocument.4.0")
xmlResponse.async = false
xmlResponse.LoadXml(myXML)
Set xmlHttp = Nothing

Set objLst = xmlResponse.getElementsByTagName("item")
Set xmlResponse = Nothing

intNoOfHeadlines = objLst.length -1

For i = 0 To (intNoOfHeadlines)
Set objHdl = objLst.item(i)

for each child in objHdl.childNodes
Select case lcase(child.nodeName)
case "title"
title = child.text
case "link"
link = child.text
case "description"
description = child.text
'You can also use the following: author,category,comments,enclosure,guid,pubDate,source
End Select
next

Count = Count+1
if Count < NoOfResult+1 then
Response.Write "" & title & " " & description & ""
end if

Next
End Sub
Read and display RSS feeds in classic ASP
Last Updated on Tuesday, 27 September 2011 12:31