contrib: angstrom/rss.php: quick & dirty rss generator for autobuilder uploads
[vuplus_openembedded] / contrib / angstrom / rss.php
1 <? print('<?xml version="1.0" encoding="utf-8"?>');?>
2 <rss version="2.0" xml:base="http://www.anstrom-distribution.org/unstable/autobuild/" xmlns:dc="http://purl.org/dc/elements/1.1/">
3 <channel>
4  <title>Ã…ngstrom autobuilder updates </title>
5  <link>http://www.anstrom-distribution.org/unstable/autobuild</link>
6  <description></description>
7  <language>en</language>
8 <?php
9
10 $base_path = "/home/angstrom/website/unstable/autobuild";
11
12 if ($handle = opendir("$base_path")) {
13
14         while (false !== ($file = readdir($handle))) {
15                 if(is_dir($file) && $file != "." && $file != "..") {
16                         $second_handle = opendir("$base_path/$file/");
17                         while (false !== ($file2 = readdir($second_handle))) {
18                                 if(is_file("/$base_path/$file/$file2")) { 
19                                         $fmtime = filemtime("$file/$file2");
20
21 print("<item>\n");
22 print("<title>$file/$file2 uploaded</title>\n");
23 print(" <link>http://www.anstrom-distribution.org/unstable/autobuild/$file/$file2</link>\n");
24
25 $rsstime = strftime("%a, %d %b %Y %T +0000", $fmtime);
26
27 print("<pubDate>$rsstime</pubDate>\n");
28 print("<dc:creator>Angstrom autobuilder</dc:creator>");
29 print("</item>\n");
30
31                                 }
32                         }
33                         closedir($second_handle);
34                 }    
35
36         }
37         closedir($handle);
38 }
39 ?>
40 </channel>
41 </rss>
42
43