<?php
include('functions.php');
$title 'TUM Signaldarstellung';
$url 'http://user:pass@www.mmk.ei.tum.de/lehre/sd/downloadarea/Vorlesung/';
$path 'http://www.mmk.ei.tum.de/lehre/sd/downloadarea/Vorlesung/'
$description '';
$lang 'de';

$file implode(''file($url));
//echo $file;
if ( !preg_match('#Parent Directory</a>(.+?)</pre>#is'$file$regs) )
    die(
'No match!');
$block $regs[1];
$block remove_comments($block);
if ( !
preg_match_all('#<a href="(?:.+?)">(.+?)</a>#is'$block$regs))
    die(
'No entry matches!');
//echo '<pre>'; var_dump($regs); echo '</pre>';

header('Content-Type: application/rss+xml; charset=latin1');
echo 
'<?xml version="1.0"?>
<rss version="2.0">
    <channel>
        <title>' 
$title '</title>
        <link>' 
$url '</link>
        <description>' 
$description '</description>
        <language>' 
$lang '</language>
        <pubDate>' 
date('r') . '</pubDate>
'

/* <lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate> */
for ( $i count($regs[0])-1$i >= 0$i-- )
{
    
$item_title 'SD ' str_replace('_'' 'substr($regs[1][$i], 0, -4)); 
    
$item_url $path $regs[1][$i]; 
    echo 
'
        <item>
            <title>' 
$item_title '</title>
            <link>' 
$item_url '</link>
            <description></description>' 
/*
            <pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>*/ 
'
            <guid>' 
$item_url '</guid>
            <enclosure url="' 
$item_url '" length="1" type="application/pdf" />
        </item>'
;
}
echo 
'
    </channel>
</rss>
'
;
?>