Consuming Flickr RSS feed using ColdFusion MX
The following code will make a http request for a Flickr RSS feed, and output the results. You may want to cfdump the XMLContent variable to see what other values you can use from the feed. Enjoy...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Consuming Flickr RSS feed using ColdFusion MX</title>
</head>
<body>
<cfhttp url="http://api.flickr.com/services/feeds/groups_pool.gne?id=77561358@N00&format=rss_200" method="GET"></cfhttp>
<cfscript>
XMLContent = trim(cfhttp.filecontent);
XMLContent = XMLParse(XMLContent);
</cfscript>
<cfloop from="1" to="#ArrayLen(XMLContent.rss.channel.item)#" index="idx">
<cfoutput>
Link to Flickr: <a href="#XMLContent.rss.channel.item[idx].link.xmlText#">#XMLContent.rss.channel.item[idx].title.xmlText#</a><BR>
Image: <img src='#XMLContent.rss.channel.item[idx]["media:thumbnail"].xmlattributes.url#'><BR>
Author: #XMLContent.rss.channel.item[idx].author.xmlText#<BR>
Date: #XMLContent.rss.channel.item[idx].pubDate.xmlText#
</cfoutput>
<hr>
</cfloop>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Consuming Flickr RSS feed using ColdFusion MX</title>
</head>
<body>
<cfhttp url="http://api.flickr.com/services/feeds/groups_pool.gne?id=77561358@N00&format=rss_200" method="GET"></cfhttp>
<cfscript>
XMLContent = trim(cfhttp.filecontent);
XMLContent = XMLParse(XMLContent);
</cfscript>
<cfloop from="1" to="#ArrayLen(XMLContent.rss.channel.item)#" index="idx">
<cfoutput>
Link to Flickr: <a href="#XMLContent.rss.channel.item[idx].link.xmlText#">#XMLContent.rss.channel.item[idx].title.xmlText#</a><BR>
Image: <img src='#XMLContent.rss.channel.item[idx]["media:thumbnail"].xmlattributes.url#'><BR>
Author: #XMLContent.rss.channel.item[idx].author.xmlText#<BR>
Date: #XMLContent.rss.channel.item[idx].pubDate.xmlText#
</cfoutput>
<hr>
</cfloop>
</body>
</html>


<< Home