[thelist] CFMX and RSS
Russ
russ at unrealisticexpectations.com
Tue Jun 28 18:09:36 CDT 2005
I'm having a minor bit of a nightmare--something that's driving me nuts,
actually.
I'm using the following code within CFMX to bring down an RSS feed:
<!--- download the xml document using http --->
<cfhttp method="GET" url="http://www.website.com/wpost.xml">
<!--- parse the XML text into a CF variable --->
<cfset newsfeed=XMLParse(Trim(cfhttp.filecontent))>
<!--- uncomment next line to see XML content --->
<!--- <cfdump var="#newsfeed#"> --->
<!--- use XPath to search for headlines and links
XMLSearch returns an array of found records --->
<!--- this will find all "items" with a "title" tag underneath within
<rss> and <channel> tags --->
<cfset category=XMLSearch(newsfeed,'/rss/channel/category')>
<!--- similar to above, this will find the URL referenced by each
story --->
<cfset title=XMLSearch(newsfeed,'/rss/channel/item/title')>
<cfset links=XMLSearch(newsfeed,'/rss/channel/item/link')>
<cfset description=XMLSearch(newsfeed,'/rss/channel/item/description')>
<!--- This is all the XML Stuff to Bring Down The Feed --->
Seems to work at home just fine on my WinServer2003. No issues
whatsoever. When I upload it to my Fedora box, however, it's chugging
and puking on my like crazy. It's nasty.
It doesn't seem like it should be, so I'm wondering if anyone has a
different solution that they're using or if anyone can help me out?
An alternate solution I've used is to set a cron job to run and get the
XML file and save it locally so as to not run to the server all the
time. This hasn't really helped much, but it was worth a shot.
The display code is pretty simple, in case it helps:
<cfoutput>
<cfloop from="1" to="5" index="n">
<tr>
<td class="navBottomStroke"><a href="#links[n].xmltext#"
class="navigation"
target="_new">#title[n].xmltext#</a><br>#description[n].xmltext#
</td>
</tr>
</cfloop>
</cfoutput>
Thanks in advance for any help.
Russ
More information about the thelist
mailing list