473,387 Members | 1,374 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Trouble with rss2html.asp

I am primarily a front-end designer and not familiar with ASP beyond
breaking up pages into include files. Recently, one of my freelance
clients wanted to display an RSS feed from his blog on his site. I did
some research and found the rss2html.asp script. I chose this over a
javascript solution because those scripts apparently don't affect
search engine rankings.

I implemented the script and it was running fine until about a month
ago, when the site and sometimes the server running it started to
crash. The ISP and the blog company the RSS feed originates from blame
the script. Bytescout, who wrote the script, says that it's probably
the feed that's causing the problem. The RDF version of the feed
validates as RSS, but the ATOM one has specs that are too new for the
validator to parse correctly.

I'm inclined to think that the way I implemented the script is causing
the problem. I'll post it below:

<%
' =========== RSS2HTML.ASP for ASP/ASP.NET ==========
' copyright 2005 (c) www.Bytescout.com
' ===============================================

' =========== configuration =====================
' ##### URL to RSS Feed to display #########
'URLToRSS = "http://rssnewsapps.ziffdavis.com/tech.xml"
'URLToRSS =
"http://stopyouranger.typepad.com/anger_in_the_news/atom.xml"
'URLToRSS =
"http://stopyouranger.typepad.com/anger_in_the_news/index.rdf"
'URLToRSS = "http://www.ajnovickgroup.com/weblog/atom.xml"
'URLToRSS = "http://www.rssmix.com/u/4592/rss.xml"
URLToRSS = "http://www.feedjumbler.com/ea511d86/rss.xml"

' ##### max number of displayed items #####
MaxNumberOfItems = 7

' ##### Main template constants
MainTemplateHeader = "<ul class=""leftnav"">"
MainTemplateFooter = "</ul>"
' #####

' ##### Item template.
' ##### {LINK} will be replaced with item link
' ##### {TITLE} will be replaced with item title
' ##### {DESCRIPTION} will be replaced with item description
ItemTemplate = "<li><a href=" & """{LINK}""" & ">{TITLE}</a></li>"

' ##### Error message that will be displayed if not items etc
ErrorMessage = "<p>Feed temporarily unavailable.<br /> Please try
again later.</p>"

' ================================================

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

Set xmlDOM = Server.CreateObject("MSXML2.DomDocument.3.0")
xmlDOM.async = false
xmlDOM.LoadXml(RSSXML)

Set xmlHttp = Nothing ' clear HTTP object

Set RSSItems = xmlDOM.getElementsByTagName("item") ' collect all
"items" from downloaded RSS
Set xmlDOM = Nothing ' clear XML

RSSItemsCount = RSSItems.Length-1

' writing Header
if RSSItemsCount > 0 then
Response.Write MainTemplateHeader
End If

j = -1

For i = 0 To RSSItemsCount
Set RSSItem = RSSItems.Item(i)

for each child in RSSItem.childNodes
Select case lcase(child.nodeName)
case "title"
RSStitle = child.text
case "link"
RSSlink = child.text
case "description"
RSSdescription = child.text
End Select
next

j = J+1

if J<MaxNumberOfItems then
ItemContent = Replace(ItemTemplate,"{LINK}",RSSlink)
ItemContent = Replace(ItemContent,"{TITLE}",RSSTitle)
Response.Write Replace(ItemContent,"{DESCRIPTION}",RSSDescription )
ItemContent = ""
End if

Next

' writing Footer
if RSSItemsCount > 0 then
Response.Write MainTemplateFooter
else
Response.Write ErrorMessage
End If

' Response.End
%>

Can anyone tell me what's going on???

Thanks,

--keith

Aug 4 '05 #1
0 1924

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: James | last post by:
Hi I am having some trouble getting a asp page to load. Im a noob to the asp side. I have followed knowledege base Article 301305. I am running 2000 adv, IIS 5.0 I have the following...
4
by: Jacek Dziedzic | last post by:
Hi! First of all, I hope my problem is not too loosely tied to the "standard C++" that is the topic of this group. I have some code that exhibits a strange behaviour: on one computer, where I...
0
by: Paul C | last post by:
Hello, everybody. I am having trouble running some of the VS.NET samples, specifically the CarSelector web app, which is very simple. The symptom is that the web controls (drop down listboxes and...
0
by: Alexandre Jaquet | last post by:
Hi does anybody know how to solve my trouble, when I try to create a MS Office project I always got trouble. I can't create office project when I try to create one vs.net restart ... :s
1
by: Jim Bancroft | last post by:
Hi everyone, I'm running into a problem with my ASP.Net application. I've just created a new aspx page which uses some new components of mine that inherit from ServicedComponent and are...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
2
by: JLupear | last post by:
I am having trouble with my code again, I had prepared a question and the code to upload, however I am having trouble posting it, are there limits to the amount of lines you can post? I split it...
0
by: mrchatgroup | last post by:
news from http://www.mrchat.net/myblog/myblog/small-accidents-mean-big-trouble-for-supercollider.html Small Accidents Mean Big Trouble for Supercollider Image Scientists expect startup...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.