The Foundeo ColdFusion Feed Parser can parse RSS 0.9, RSS/RDF 1.0, RSS 2.0, and ATOM 1.0 feeds. The parseFeed function returns a simple ColdFusion query object. The same query columns are returned no matter what kind of feed is being parsed, though some columns may be empty.
ColdFusion MX 6.0 and up
parseFeed functionThe parseFeed function takes two arguments.
| Argument Name | Required | Description |
|---|---|---|
feed |
Yes | This is a URL pointing to an RSS feed, for example: https://www.petefreitag.com/rss/ |
cacheHours |
No | The number of hours to cache this feed for. The default value is 0 which does not perform any caching. It is recommended that you use this setting. Most feeds are not updated more frequently than once per hour. Some webmasters will ban your IP address if you fetch a feed too many times. |
This function returns a ColdFusion query object with the following columns:
| Query Column | Type |
|---|---|
title |
string |
link |
url |
description |
string |
date |
date/time |
id |
string |
<cfinclude template="feedparser.cfm">
<cfset feed = parseFeed("https://www.petefreitag.com/rss/")>
<ul>
<cfoutput query="feed">
<li><a href="#feed.link#">#feed.title#</a></li>
</cfoutput>
</ul>
purgeExpiredFeedsFromCache FunctionThis function allows you to manually purge the feed cache, you should not need to call this function, as it is called automatically by the parseFeed function each time a feed is added to the cache.
clearFeedCache FunctionThis function deletes all feeds from the feed cache.
The feed parser cannot parse feeds that are not well formed XML, or do not comply with the RSS or ATOM specifications.