|
Its actually easier than it looks. I have attached an example of what I use to process an RSS feed from CF Developers Journal. To create the feed is simply a case of creating a text file that l;ooks something like the feed from CFDJ.
I am in the process of doing this for one of my client s so once it is done I will send it up for you.
Ellis C Wood BSc Ellwood Web Solutions
T: 01623 459973 -----Original Message-----
I'll follow this thread with interest, as it's something I may need to get done (as opposed to do myself) at some stage. There's a possibility I may need at some point in the next 6-12 months to supply a data feed to Tourism South East from ArtSouthEast (the site what I wrote).
Ian W
|
<!--- 1. Grab
the CFDJ RSS feed --->
<cfhttp url="http://www.sys-con.com/coldfusion/feed.rss" method="get"></cfhttp>
<!--- 2. Read XML file into string variable called MyXmlCode --->
<CFSET xmlRSS = xmlParse(CFHTTP.FileContent)>
<!--- 3. The "root element" of this XML Object --->
<CFSET xnNewsFeed = xmlRSS.XmlRoot>
<CFSET nNumChannels = ArrayLen(xnNewsFeed.XmlChildren)>
<cfset ChannelCount = 2>
<table width="440" border="0" cellpadding="0" cellspacing="0" class="text">
<tr>
<td colspan="5" class="hoz-line"><img src="images/blank.gif"></td>
</tr>
<tr>
<td class="hoz-line" width="1"><img src="images/blank.gif" width="1"></td>
<th colspan="3" class="heading">Coldfusion Developers Journal - RSS Feed</td>
<td class="hoz-line" width="1"><img src="images/blank.gif" width="1"></td>
</tr>
<tr>
<td colspan="5" class="hoz-line"><img src="images/blank.gif"></td>
</tr>
<cfloop index="loopcount" from="2" to="#nNumChannels#">
<CFSET xnArticle = xnNewsFeed.XmlChildren[#channelCount#]>
<CFSET xnTitle = xnArticle.XmlChildren[1]>
<CFSET xnLink = xnArticle.XmlChildren[2]>
<CFSET xnDescription = xnArticle.XmlChildren[3]>
<CFSET xnDate = xnArticle.XmlChildren[4]>
<CFSET sTitle = xnTitle.XmlText>
<CFSET sLink = xnLink.XmlText>
<CFSET sDescription = xnDescription.XmlText>
<CFSET dDate = xnDate.XmlText>
<tr>
<td colspan="5"><img src="images/blank.gif" height="10"></td>
</tr>
<CFOUTPUT>
<tr>
<td colspan="5" class="hoz-line"><img src="images/blank.gif"></td>
</tr>
<tr>
<td class="hoz-line" width="1"><img src="images/blank.gif" width="1"></td>
<th class="heading" style="text-align: left;" valign="top" nowrap>Title</th>
<td class="hoz-line" width="1"><img src="images/blank.gif" width="1"></td>
<td><a href="#sLink#"><b>#sTitle#</b></a> - #dDate#</td>
<td class="hoz-line" width="1"><img src="images/blank.gif" width="1"></td>
</tr>
<tr>
<td colspan="5" class="hoz-line"><img src="images/blank.gif"></td>
</tr>
<tr>
<td class="hoz-line" width="1"><img src="images/blank.gif" width="1"></td>
<th class="heading" style="text-align: left;" valign="top">Description</th>
<td class="hoz-line" width="1"><img src="images/blank.gif" width="1"></td>
<td>#sDescription#</td>
<td class="hoz-line" width="1"><img src="images/blank.gif" width="1"></td>
</tr>
<tr>
<td colspan="5" class="hoz-line"><img src="images/blank.gif"></td>
</tr>
<tr>
<td colspan="5"><img src="images/blank.gif" height="10"></td>
</tr>
<cfset ChannelCount = ChannelCount + 1>
</CFOUTPUT>
</cfloop>
</table>
-- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED]
