Reading RSS Feeds
With the release of Coldfusion 8 you are now able to both read and write RSS or Atom feeds using a new tag called CFFEED. This tutorial will cover how to set up a feed reader.
To set up a feed reader you first need to have an address to an RSS or Atom feed. We can use the feed URL from my blog http://www.garyrgilbert.com/blog/rss.cfm as a valid feed address.
Once you have a valid address you need to set up your CFFEED tag to go out and reed the feed:
properties = "feedProperties"
query = "feedQuery">
The Results
Thats pretty much all you have to do to get Coldfusion to read an RSS or Atom feed. The properties attribute of the tag holds all the properties of the RSS feed.
If you were to dump out the properties after running the above code you would end up with something that looked like:
The variable feedQuery would contain a query of all of the blog entries returned. In the case of my rss feed the last 15 blog entries. You could then output
the query anyway you like, for example you could output it like so:
<h3><a href = "#rsslink#">#title#</a></h3>
<p><b>Published:</b> #publisheddate#</p>
<p>#content#</p>
</cfoutput>