diff options
author | Marcin Juszkiewicz <hrw@openembedded.org> | 2007-12-06 20:04:26 +0000 |
---|---|---|
committer | Marcin Juszkiewicz <hrw@openembedded.org> | 2007-12-06 20:04:26 +0000 |
commit | fb89e1265c288b619f04c0f6c06193c8e1a0a46d (patch) | |
tree | 35a2806eff0093b32533375a658b1a2cf0f02e38 /contrib/angstrom/rss.php | |
parent | a780b447814eb7c2c42251236d944dbb277d79d7 (diff) |
Ångström autobuilder: new RSS generator
Diffstat (limited to 'contrib/angstrom/rss.php')
-rw-r--r-- | contrib/angstrom/rss.php | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/contrib/angstrom/rss.php b/contrib/angstrom/rss.php index 8970ba1797..cf5a9e0218 100644 --- a/contrib/angstrom/rss.php +++ b/contrib/angstrom/rss.php @@ -1,43 +1,48 @@ -<? print('<?xml version="1.0" encoding="utf-8"?>');?> +<?php echo ('<?xml version="1.0" encoding="utf-8"?>'); ?> <rss version="2.0" xml:base="http://www.angstrom-distribution.org/unstable/autobuild/" xmlns:dc="http://purl.org/dc/elements/1.1/"> -<channel> - <title>Ångstrom autobuilder updates </title> - <link>http://www.angstrom-distribution.org/unstable/autobuild</link> - <description></description> - <language>en</language> + <channel> + <title>Ångström autobuilder updates</title> + <link>http://www.angstrom-distribution.org/unstable/autobuild/</link> + <description></description> + <language>en</language> <?php $base_path = "/home/angstrom/website/unstable/autobuild"; -if ($handle = opendir("$base_path")) { +if ($handle = opendir("$base_path")) +{ + while (false !== ($file = readdir($handle))) + { + if(!(is_dir($file) && $file != "." && $file != "..")) + { + continue; + } - while (false !== ($file = readdir($handle))) { - if(is_dir($file) && $file != "." && $file != "..") { - $second_handle = opendir("$base_path/$file/"); - while (false !== ($file2 = readdir($second_handle))) { - if(is_file("/$base_path/$file/$file2")) { - $fmtime = filemtime("$file/$file2"); + $second_handle = opendir("$base_path/$file/"); -print("<item>\n"); -print("<title>$file/$file2 uploaded</title>\n"); -print(" <link>http://www.angstrom-distribution.org/unstable/autobuild/$file/$file2</link>\n"); + while (false !== ($file2 = readdir($second_handle))) + { + if(is_file("/$base_path/$file/$file2")) + { + $fmtime = filemtime("$file/$file2"); -$rsstime = strftime("%a, %d %b %Y %T +0100", $fmtime); + echo "<item>\n" + echo "<title>$file/$file2 uploaded</title>\n"; + echo " <link>http://www.angstrom-distribution.org/unstable/autobuild/$file/$file2</link>\n"; -print("<pubDate>$rsstime</pubDate>\n"); -print("<dc:creator>Angstrom autobuilder</dc:creator>"); -print("</item>\n"); + $rsstime = strftime("%a, %d %b %Y %T +0100", $fmtime); - } + echo "<pubDate>$rsstime</pubDate>\n"; + echo "<dc:creator>Angstrom autobuilder</dc:creator>"; + echo "</item>\n"; } - closedir($second_handle); - } + } + closedir($second_handle); } + closedir($handle); } ?> -</channel> + </channel> </rss> - - |