Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <cfscript>
  2. // Use feedservice to READ an RSS feed (XML)
  3. try {
  4.     f = new feed();
  5.     rsFeed = f.read(source="http://path.to/feed").Query;
  6. }
  7. catch (any excpt) {
  8.     rsFeed = "";
  9. }
  10. finally {
  11.     // Use WriteDump to display the result query to fine tune what you want to output
  12.     WriteDump(rsFeed);
  13.    
  14.     //Use this to output the resulting feed wherever you want
  15.     if (isQuery(rsFeed)) {
  16.         for (i = 1; i <= rsFeed.RecordCount; i++) {
  17.             WriteOutput('<p>
  18.                 <a href="' & rsFeed["rssLink"][i] & '">' & rsFeed["Title"][i] & '</a><br />
  19.                 <small class="nowrap">' & DateFormat(rsFeed["PublishedDate"][i], "mmm d, yyyy") & '</small>
  20.             </p>');
  21.         }
  22.     } else {
  23.         WriteOutput('<p>Feed is temporarily unavailable.</p>');
  24.     }
  25. }
  26. </cfscript>