|
Revision 5, 1.3 kB
(checked in by DanWilson, 17 years ago)
|
|
Initial Commit Of ModelGlue? Website (upgrade to blogcfc 511)
|
| Line | |
|---|
| 1 | <cfsetting enablecfoutputonly=true> |
|---|
| 2 | <cfprocessingdirective pageencoding="utf-8"> |
|---|
| 3 | <!--- |
|---|
| 4 | Name : feed.cfm |
|---|
| 5 | Author : Raymond Camden |
|---|
| 6 | Created : September 20, 2006 |
|---|
| 7 | Last Updated : November 17, 2007 |
|---|
| 8 | History : Forgot the enableoutputonly false |
|---|
| 9 | |
|---|
| 10 | Note - this pod is meant to allow you to easily show |
|---|
| 11 | another site's RSS feed on your blog. You should |
|---|
| 12 | edit the title to match the site you are hitting. |
|---|
| 13 | You may also need to edit the xmlSearch tag based |
|---|
| 14 | on the type of RSS feed you are using. |
|---|
| 15 | ---> |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | <cfmodule template="../../tags/podlayout.cfm" title="Latest from CFBloggers.org"> |
|---|
| 19 | |
|---|
| 20 | <cfmodule template="../../tags/scopecache.cfm" scope="application" cachename="feed" timeout="#60*60#"> |
|---|
| 21 | |
|---|
| 22 | <cftry> |
|---|
| 23 | <cfset theURL = "http://www.coldfusionbloggers.org/rss.cfm"> |
|---|
| 24 | <cfhttp url="#theURL#" timeout="5"> |
|---|
| 25 | |
|---|
| 26 | <cfset xml = xmlParse(cfhttp.filecontent)> |
|---|
| 27 | <cfset items = xmlSearch(xml, "//*[local-name() = 'item']")> |
|---|
| 28 | <cfloop index="x" from="1" to="#min(arrayLen(items),5)#"> |
|---|
| 29 | <cfset item = items[x]> |
|---|
| 30 | <cfoutput> |
|---|
| 31 | <a href="#item.link.xmlText#">#item.title.xmlText#</a><br> |
|---|
| 32 | </cfoutput> |
|---|
| 33 | </cfloop> |
|---|
| 34 | <cfcatch> |
|---|
| 35 | <cfoutput> |
|---|
| 36 | Feed temporarily down. |
|---|
| 37 | </cfoutput> |
|---|
| 38 | </cfcatch> |
|---|
| 39 | </cftry> |
|---|
| 40 | |
|---|
| 41 | </cfmodule> |
|---|
| 42 | |
|---|
| 43 | </cfmodule> |
|---|
| 44 | <cfsetting enablecfoutputonly=false> |
|---|