= cacheTime) { if (@copy($url, $cacheFile)) { include("feedcreator.class.php"); $rss = new UniversalFeedCreator(); $rss->title = "processing.org user exhibition"; $rss->description = "list of most recent exhibition entries"; $rss->link = "http://processing.org/exhibition/"; $rss->syndicationURL = "http://toxi.co.uk/feeds/p5exhibits.php"; $html = @file($cacheFile); if ($html!=null) { $itemOpen=false; $item=null; $exhibStarted=false; foreach($html as $n => $line) { if (!$exhibStarted) { if (strpos($line,'')!=false) { $exhibStarted=true; } } else { if (strpos($line,'Previous links')!=false) break; if (preg_match('/(.*)<\/a>/',$line,$matches)) { if ($itemOpen) { $rss->addItem($item); } $postURL=$matches[1]; $item = new FeedItem(); $item->title = $matches[2]; $item->link = $postURL; $itemOpen=true; $authorSet=false; } if ($itemOpen) { if (!$authorSet) { if (preg_match('/(.*)
(.*)<\/font>/',$line,$matches)) { $item->author=trim($matches[1]); $time=strip_tags($matches[2]); $time=str_replace("'","20",$time); $item->date=strtotime($time); $authorSet=true; } } } } } // add last entry if ($itemOpen) { $rss->addItem($item); } $rss->saveFeed("Atom", $cacheFile); } } } header('Content-Type: application/atom+xml'); readfile($cacheFile); ?>