cache_dir = 'cache'; //path to cache directory on your server from this script. Chmod 777! $rss->date_format = 'M d, Y g:i:s A'; //date format of RSS item. See PHP date() function for possible input. // List of RSS URLs $rsslist=array( "WR" => "http://www.webreference.com/webreference.rdf", "WDF" => "http://www.webdeveloper.com/icom_includes/feeds/special/wd_forum.xml" ); ////Beginners don't need to configure past here//////////////////// $rssid=$_GET['id']; $rssurl=isset($rsslist[$rssid])? $rsslist[$rssid] : die("Error: Can't find requested RSS in list."); // ------------------------------------------------------------------- // outputRSS_XML()- Outputs the "title", "link", "description", and "pubDate" elements // of an RSS feed in XML format // ------------------------------------------------------------------- function outputRSS_XML($url) { global $rss; $cacheseconds=(int) $_GET["cachetime"]; //typecast "cachetime" parameter as integer (0 or greater) $rss->cache_time = $cacheseconds; if ($rs = $rss->get($url)) { echo "\n\n\n"; foreach ($rs['items'] as $item) { echo "\n$item[link]\n$item[title]\n$item[description]\n$item[pubDate]\n\n\n"; } echo ""; if ($rs['items_count'] <= 0) { echo "
  • Sorry, no items found in the RSS file :-(
  • "; } } else { echo "Sorry: It's not possible to reach RSS file $url\n
    "; // you will probably hide this message in a live version } } // =============================================================================== outputRSS_XML($rssurl); ?>