Forum Moderators: open

Message Too Old, No Replies

Issue with code. please help!

Using ASP for RSS

         

sbridge

8:06 pm on Mar 4, 2008 (gmt 0)

10+ Year Member



Hello all...

I am having some issues with this code. My previous supervisor who had worked here coded this. He left and I'm stuck with this issue, since I have no knowledge of RSS Feeds and enough knowledge of ASP to get through the day.

Anyway-- I keep getting this error

---------------------------------------------------
Microsoft VBScript runtime error '800a01a8'
Object required

/news.asp, line 41
---------------------------------------------------

I look at Line 41 and it's this

---------------------------------------------------
for each child in RSSItem.childNodes
---------------------------------------------------

I don't understand why this isn't working! I checked all the variables and they all seem to match. Am I missing something? This is all happening b/c the RSS Feed provider changed around their feed and now everything is f'ed up! PLEASE HELP!

Below is the entire code for the page, with the exceptions of the header and footer includes which is all HTML... no ASP.

---------------------------------------------------
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Set the following to the url of the RSS news feed
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
URLToRSS = "http://www.inman.com/syndication/mlsli/rss.aspx?cust=2464"

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Fetch the XML data
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set xmlHttp = Server.CreateObject("MSXML2.XMLHTTP.3.0")
xmlHttp.Open "Get", URLToRSS, false
xmlHttp.Send()
RSSXML = xmlHttp.ResponseText

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Convert to XML object
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set xmlDOM = Server.CreateObject("MSXML2.DomDocument.3.0")
xmlDOM.async = false
xmlDOM.LoadXml(RSSXML)

Set xmlHttp = Nothing

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Find specific article
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
set RSSitem = xmlDOM.SelectSingleNode("channel/item[guid=" & Request("guid") & "]")
Set xmlDOM = Nothing
%>
<table class=bodytext>
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Find the fields of interest
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
for each child in RSSItem.childNodes
Select case lcase(child.nodeName)
case "title"
RSStitle = child.text
case "pubdate"
RSSdate = child.text
case "description"
RSSbody = child.text
case "author"
RSSauthor = child.text
End Select
next

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Display News Article
'' Variables:
''Article Title >> RSStitle
''Article Publication Date >> RSSddate
''Article Body >> RSSbody
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
%>
<tr>
<td>
<h3><%=RSStitle%></h3>
<div align="right"><EM><%=RSSdate%></EM><BR> </div>
<strong><%=RSSAuthor%></strong>
<span class=bodytext><%=RSSbody%></span>
</td>
</tr>
</table>

The page that has the listings of all the articles works fine... the "details" page is what's having all the issues...

Article list:
[mlsli.com...]

** Click on ANY title and it will take you to the error...

Any help would be appreciated! :)

mattur

7:13 pm on Mar 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi sbridge, welcome to webmasterworld! [webmasterworld.com]

I think RSSitem is not returning an object because it's not matching a node, and this appears to be due to a problem with your xpath code here:

set RSSitem = xmlDOM.SelectSingleNode("channel/item[guid=" & Request("guid") & "]") 

Try:

set RSSitem = xmlDOM.SelectSingleNode("//channel/item[guid=" & Request("guid") & "]") 

sbridge

8:42 pm on Mar 5, 2008 (gmt 0)

10+ Year Member



Hello mattur,

Thanks for responding. I tried and implemented the code onto the web page... still no luck. I'm getting the exact same error. Can you think of anything else? I'm so stuck, it's not even funny!

Thanks! :)

mattur

10:21 pm on Mar 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My fault, I left out the single quotes. Try:

set RSSitem = xmlDOM.SelectSingleNode("//channel/item[guid='" & Request("guid") & "']")

sbridge

12:50 am on Mar 6, 2008 (gmt 0)

10+ Year Member



Mattur,

You are a serious live saver! Thank you so much for your help. This worked perfectly!

Thanks again!

Regards,
Sathya B