\n");
echo("\t$id\n");
echo("\t" . strftime("%Y-%m-%dT%H:%M:%SZ", $update) . "\n");
echo("\t
$title\n");
echo("\t\n");
echo("\t$desc\n");
echo("\n\n");
}
echo(' version="1.0" encoding="UTF-8"?>
Změny v rozvrhu SSPŠ
Aktuální změny v rozvrhu SSPŠ
http://www.ssps.cz/favicon.ico
tag:ssps.cz,2008:
SSPŠ
]+>', iconv('WINDOWS-1250', 'UTF-8', file_get_contents($url)));
$date = 0;
$update = 0;
$lastUpdate = 0;
ob_start();
foreach($feed as $line) {
$line = trim($line);
if($line == '' || eregi('rozvrhy', $line)) continue;
# Last update?
if (eregi("^Aktualizováno: (..)\.(..)\.(....) (..:..:..)$", $line, $r))
{
$update = strtotime("{$r[3]}-{$r[2]}-{$r[1]} {$r[4]}");
# This is the last update of the whole feed
if ($lastUpdate < $update)
$lastUpdate = $update;
continue;
}
# What day are we reading?
if (eregi("^[^ ]+ (..)\.(..)\.(....)$", $line, $r))
{
$date = strtotime("{$r[3]}-{$r[2]}-{$r[1]}");
continue;
}
# Found a line about our class
if ($date && eregi($croom, $line))
{
$days = array('Ne', 'Po', 'Út', 'St', 'Čt', 'Pá', 'So');
$wday = localtime($date, TRUE);
$wday = $days[$wday['tm_wday']];
atomPrintItem($wday . strftime(" %d.%m. ", $date) . $line,
"tag:ssps.cz," . strftime("%Y-%m-%d:", $date) . md5($line),
$update, $url, $line);
}
}
$feed = ob_get_contents();
ob_end_clean();
# Must appear before the items
echo ("\t" . strftime("%Y-%m-%dT%H:%M:%SZ", $lastUpdate) . "\n");
echo $feed;
?>