Question
Help returning XML description w/ BlogCFC feed pod
This is the feed.cfm from BlogCFC. Currently it returns the
last 5
titles of a blog's XML feed.
In addition to displaying the title I'd also like it to display the
first ten words of the description.
Here's the code:
<cftry>
<cfset theURL =
" http://weblogs.macromedia.com/mxna/xml/rss.cfm?query=byMostRecent&languages=1">
<cfhttp url="#theURL#">
<cfset xml = xmlParse(cfhttp.filecontent)>
<cfset items = xmlSearch(xml, "//*[local-name() = 'item']")>
<cfloop index="x" from="1" to="#min(arrayLen(items),5)#">
<cfset item = items>
<cfoutput>
<a href="#item.link.xmlText#">
#item.title.xmlText#
</a>
<br>
</cfoutput>
</cfloop>
<cfcatch>
<cfoutput>
Feed temporarily down.
</cfoutput>
</cfcatch>
</cftry>
titles of a blog's XML feed.
In addition to displaying the title I'd also like it to display the
first ten words of the description.
Here's the code:
<cftry>
<cfset theURL =
" http://weblogs.macromedia.com/mxna/xml/rss.cfm?query=byMostRecent&languages=1">
<cfhttp url="#theURL#">
<cfset xml = xmlParse(cfhttp.filecontent)>
<cfset items = xmlSearch(xml, "//*[local-name() = 'item']")>
<cfloop index="x" from="1" to="#min(arrayLen(items),5)#">
<cfset item = items
<cfoutput>
<a href="#item.link.xmlText#">
#item.title.xmlText#
</a>
<br>
</cfoutput>
</cfloop>
<cfcatch>
<cfoutput>
Feed temporarily down.
</cfoutput>
</cfcatch>
</cftry>