added tips to lamer.bash help
[mirrors/Programs.git] / php / suplovani / suplovani.php
1 #!/usr/bin/php
2 <?php
3 $url = 'http://www.ssps.cz/pages/rozvrhy/index.php';
4 $croom = '3.A';
5
6 function rss_add_item($title, $link='', $desc='') {
7 echo("\n<item>\n");
8 echo("\t<title>$title</title>\n");
9 echo("\t<link>$link</link>\n");
10 echo("\t<description>$desc</description>\n");
11 echo("</item>\n\n");
12 }
13 ?>
14 <?php echo('<?xml'); ?> version="1.0" encoding="windows-1250"?><rss version="0.91"><channel>
15
16 <title>Zmeny v rozvrhu SSPS</title>
17 <link><?php echo($url); ?></link>
18 <description>Aktualni zmeny v rozvrhu SSPS</description>
19 <language>cs</language>
20
21 <?php
22 $croom = str_replace('.', '\.', $croom);
23 $feed = spliti('<.?..>', file_get_contents($url));
24
25 foreach($feed as $line) {
26 $line = trim($line);
27 if($line == '' || eregi('rozvrhy', $line)) continue;
28 if(eregi($croom, $line)) rss_add_item($line, $url);
29 }
30
31 ?>
32
33 </channel></rss>
This page took 1.191678 seconds and 4 git commands to generate.