ATOM and RSS Feeds and ColdFusion 8
I’ve come across a couple of cases where it may be useful to embed an rss or atom feed into an application. With CF 8 there is now the cffeed tag that enables this to be done quickly and easily. In addition to reading feeds this tag also allows for the creation of feeds.
This entry and the linked samples deal only with reading and parsing feeds but should there be interest I can follow up with a create example. There are a number of attributes of the tag to be aware of.
- action: create or read
- name: the name of the structure to receive the feed data
- xmlvar: optional variable to save the feed as xml data
- source: url of the feed.
For additional information about this tag refer to Adobe Live Docs
The sample applicationhttp://cfsrvtst.skidmore.edu/dev/dgreen/cf8samples/cffeed/ displays blog entries from several Skidmore Moveable Type atom feeds. The first displays a single blog with all code included in the page. The second example retrieves multiple blogs using a cfc to retrieve the feed data. I always wanted to play around with creating queries with the cfquery tag so instead of using the query attribute of the cffeed tag I used cfquery to create the query returned from the cfc.
This is a very simple set of examples but it should open up the possibilities to you such as embedding feeds into course ware, merging multiple feeds together into one list, creating blog aggregators, etc.
