Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert RSS to HTML using ASP

Status
Not open for further replies.

OreoBean1

Technical User
Oct 23, 2005
27
US
Hey everyone,

I have this script for converting RSS to HTML using an ASP script. I can add any RSS href and it should open it and display it in HTML. The problem is it gives an error always on the same line 'objHttp.Send'. Any ideas what this line is?

This is the script:

<%
set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "POST", " false
objHttp.Send
If objHttp.status = 200 Then
response.write(objHttp.responseText)
End If
set objHttp = nothing
%>
 
Ok, did that. The resource is not found now, no errors, just not found.

I'm trying to display the feed on my HTML page, not provide a link for a reader though. Do I have to install an aggregator on the webserver? Because my hosting does not support PHP on it's servers.

I was hoping to include the feed from the ASP file on the existing HTML page. Any suggestions?
 
OreoBean1 said:
The resource is not found now, no errors, just not found.

How do you know it is not found if there are no errors ?

What has PHP got to do with it ? I thought you were using ASP?

isn't a valid domain... I'm hoping that this is not the real address you are trying and that it was an example - can you supply the real address - have you tried it manually? what does it produce anything ?

The example provided above DOES work for others - so something about your implementation is different - try this:

Code:
<%
set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "GET", "[URL unfurl="true"]http://example.com/feed.php",[/URL] false
objHttp.Send
If objHttp.status = 200 Then
response.write("Status (OK): " & objHttp.responseText)
else
 response.write("Status (Failed): " & objHttp.status)
End If
set objHttp = nothing
%>

Post back which it produces.


A smile is worth a thousand kind words. So smile, it's easy! :)
 
damber said:
The example provided above DOES work for others - so something about your implementation is different - try this:

Code:
<%
set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "GET", "[URL unfurl="true"]http://example.com/feed.php",[/URL] false
objHttp.Send
If objHttp.status = 200 Then
response.write("Status (OK): " & objHttp.responseText)
else
 response.write("Status (Failed): " & objHttp.status)
End If
set objHttp = nothing
%>


The code does not return any errors about the objects. Please remember I am a novice with this, however even a feed I can open in the google reader is not displaying an output with this code. Before I get to far ahead of myself, I setup this code on an asp page with RSS feed When I open the page it returns this error verbatum:

msxml3.dll error '800c0005'

The system cannot locate the resource specified.

/rss2html.asp, line 42


So, what am I doing wrong?
 
This is the code above wrapped in the usual HTML stuff and replaced the example.com with the proper URL... It returns exactly what you would expect.

Code:
<%@ Language=VBScript %>
<html>

<head>
<title>test</title>
</head>
<body>

<%
set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
objHttp.open "GET", "[URL unfurl="true"]http://rss.news.yahoo.com/rss/hotzone",[/URL] false
objHttp.Send
If objHttp.status = 200 Then
response.write("Status (OK): " & objHttp.responseText)
else
 response.write("Status (Failed): " & objHttp.status)
End If
set objHttp = nothing
%>

</body>
</html>

Try copying and pasting this exact code into a page. If it still doesn't work post back - and give the code YOU have and point out the line where the error is.. line 42 to me means nothing.

A smile is worth a thousand kind words. So smile, it's easy! :)
 
Thanks guys. I finally found a handler that is working to an extent, still have a little work to do with it yet. if your interested in this topic, let me know I'll post the complete working code. Thanks again! I've implemented your advice and in some ways it helped.
 
An update to this issue. The RSS to HTML conversion works. I'm still having trouble including the output in HTML pages (<!-- #include -->), I have an idea of what to do to fix that though.

I am having trouble displaying the output in flash movies. Does anyone have any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top