i need to post an rss feed on my ASP site so that i can display the latest undustry news on my homepage. I used a javascript converter site: http://jade.mcli.dist.maricopa.edu And it worked fine ... until their site went down temporarily and this had a negative effect on my webpage - It wouldn't load!! - Does anyone have any better suggestions as to how i can incorporate an rss feed into my webpage without using third party sites that may crash! Thanks
Using the object Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0") Code (markup): you can parse and XML feed and display it in you web pages using ASP.
Thanks for your help - i have read this soultion but fear that my grasp of javascript is going to let me down! Is there a simple way of adding the rss feed to my site - or an online tutorial that you know of? All of the javascript generators that i find seem to be coded in php!!
I think you haven't noticed this code: It's pure ASP: <% strPANURL = "http://www.panarmenian.net/stickers/news/news_eng.rss" dim xmlDom, nodeCol, oNode, oChildNode set xmlDom = Server.CreateObject("MSXML2.Domdocument") xmlDOM.async = False call xmlDom.setProperty("ServerHTTPRequest", true) xmlDom.async = false call xmlDom.load(strPANURL) if not xmlDom.documentElement is nothing then set nodeCol = xmlDom.documentElement.selectNodes("channel/item") i = 1 for each oNode in nodeCol Response.Write("<div class='footer'>" & vbCrLf) set oChildNode = oNode.selectSingleNode("pubDate") if not oChildNode is nothing then strPubDate = Server.HTMLEncode(oChildNode.text) strPubDate = replace(strPubDate, "'", "'") strPubDate = replace(strPubDate, "&", "&") strPubDate = replace(strPubDate, vbCrLf, "<br>") Response.Write("<strong>" & strPubDate & "</strong><br>" & vbCrLf) end if set oChildNode = oNode.selectSingleNode("link") if not oChildNode is nothing then Response.Write(" <a href='" & oChildNode.text & "' target='_blank' class='footer' style='color: #CC0000;'>") strLink = "yes" end if set oChildNode = oNode.selectSingleNode("title") if not oChildNode is nothing then strTitle = Server.HTMLEncode(oChildNode.text) strTitle = replace(strTitle, "'", "'") strTitle = replace(strTitle, "&", "&") strTitle = replace(strTitle, vbCrLf, "<br>") Response.Write("" & strTitle & "") end if if strLink = "yes" then Response.Write("</a><br><br>" & vbCrLf) end if 'set oChildNode = oNode.selectSingleNode("description") 'if not oChildNode is nothing then ' Response.Write(" " & oChildNode.text & "<br/>" & vbCrLf) 'end if 'if i > 7 then exit for i = i + 1 Response.Write("</div>" & vbCrLf) next else Response.Write(strPANError & vbCrLf) end if %> Code (markup):
Maybe you need to modify it a bit? have you tried, or you just changed the url. It has been working for me so far