/lib/exe */
require_once DOKU_INC . "lib/plugins/news/scripts/feedData.php";
class externalNewsFeed extends feedData {
var $ttl;
function __construct($outfile=null,$ttl=720, $subfeed = "") {
$this->ttl = $ttl;
parent::__construct($subfeed);
$handle = null;
if($outfile) {
$handle = fopen($outfile,'wb');
if(!flock($handle,LOCK_EX)) {
fclose($handle);
return;
}
}
if($handle) {
fwrite($handle,$this->write_header());
while($this->feed_data()) {
fwrite($handle,$this->write_item());
}
fwrite($handle,$this->footer());
flock($handle,LOCK_UN);
fclose($handle);
}
else {
echo $this->write_header();
while($this->feed_data()) {
echo $this->write_item();
}
echo $this->footer();
}
}
function write_item() {
$src_url=$this->news_feed_url();
$src_title = $this->title(); ;
$link = $this->url() . '#' . $this->rss_id() ;
$title = $this->title();
$date = $this->date();
$guid = $link;
$desc = $this->description();
return <<