dev Posted June 24, 2006 Share Posted June 24, 2006 Please help me,I've downloaded a RSS Feeds reader codes in ASP; Its working very well. Here's my problem: The RSS feed which i am subscribing has 2 times & descriptions. I was trying to retrieve these 2 items and descriptions seperately.Like:item2/description = goes hereitem1/description = goes hereHere is the code <%Response.Expires = -1URLToRSS = "RSS Web Add"MaxNumberOfItems = 2Keyword1 = ""Keyword2 = ""ItemTemplate = "{DESCRIPTION}"ErrorMessage = "N/A"Set xmlHttp = Server.CreateObject("MSXML2.XMLHTTP.3.0")xmlHttp.Open "Get", URLToRSS, falsexmlHttp.Send()RSSXML = xmlHttp.ResponseTextSet xmlDOM = Server.CreateObject("MSXML2.DomDocument.3.0")xmlDOM.async = falsexmlDOM.LoadXml(RSSXML)Set xmlHttp = NothingSet RSSItems = xmlDOM.getElementsByTagName("item")Set xmlDOM = NothingRSSItemsCount = RSSItems.Length-1if RSSItemsCount > 0 then Response.Write MainTemplateHeaderEnd Ifj = -1For i = 0 To RSSItemsCountSet RSSItem = RSSItems.Item(i)for each child in RSSItem.childNodesSelect case lcase(child.nodeName)case "title"RSStitle = child.textcase "link"RSSlink = child.textcase "description"RSSdescription = child.textEnd SelectnextIf (InStr(RSSTitle,Keyword1)>0) or (InStr(RSSTitle,Keyword2)>0) or (InStr(RSSDescription,Keyword1)>0) or (InStr(RSSDescription,Keyword2)>0) thenj = J+1if J<MaxNumberOfItems then ItemContent = Replace(ItemTemplate,"{LINK}",RSSlink)ItemContent = Replace(ItemContent,"{TITLE}",RSSTitle)Response.Write Replace(ItemContent,"{DESCRIPTION}",RSSDescription)ItemContent = ""End ifEnd If Nextif RSSItemsCount > 0 then Response.Write MainTemplateFooterelse Response.Write ErrorMessageEnd If%>Please help me to solve thisSincerelyDev Link to comment Share on other sites More sharing options...
aspnetguy Posted June 26, 2006 Share Posted June 26, 2006 if you copy the code and paste and rename all the variables it will work, not the most efficient way but hte quickest and easiest. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now