aboutsummaryrefslogtreecommitdiff
path: root/web/rss.php
blob: 8b02a07b09d0f22b090f702d2277b8f04f0272f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
include("funcs.inc.php");
Header("Content-type: text/xml; charset=utf-8");
?>

<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns="http://purl.org/rss/1.0/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:admin="http://webns.net/mvcb/"
  xmlns:cc="http://web.resource.org/cc/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">

  <channel rdf:about="http://autobuild.buildroot.net">
  <title>Autobuild Buildroot results</title>
  <description>Autobuild Buildroot results</description>
  <link>http://autobuild.buildroot.net</link>
  <dc:language>en</dc:language>
  <dc:creator>buildroot.org</dc:creator>

<?php

$results = bab_get_results(0, 50);

echo " <items>\n";
echo "  <rdf:Seq>\n";
while ($current = mysql_fetch_object($results))
  echo "<rdf:li rdf:resource=\"http://autobuild.buildroot.org/results/" .
    $current->identifier . "\"/>\n";
echo "  </rdf:Seq>\n";
echo " </items>\n";
echo "</channel>\n";

mysql_data_seek($results, 0);

while ($current = mysql_fetch_object($results)) {
  echo " <item rdf:about=\"http://autobuild.buildroot.org/results/" .
    $current->identifier . "\">\n";

  if ($current->status == 0)
    $status = "successful";
  else if ($current->status == 1)
    $status = "failed";
  else if ($current->status == 2)
    $status = "timed out";

    echo "  <title>Build " . $status . " at " . $current->builddate . "</title>\n";
    echo "  <link>http://autobuild.buildroot.org/results/" .
      $current->identifier . "</link>\n";
    echo "  <description>\n";
    if ($current->status == 0) {
      echo "A Buildroot build result, submitted by " .
	$current->submitter . " was successful. The build used the Git commit id " . $current->commitid . " and was targetting the " . $current->arch . " architecture.";
    }
    else {
      echo "A Buildroot build result, submitted by " . $current->submitter . " failed. The reason of the failure is: " . $current->reason . ". The build used the Git commit id " . $current->commitid . " and was targetting the " . $current->arch . " architecture.";
    }
    echo "  </description>\n";
    echo " </item>\n\n";
  }
?>

</rdf:RDF>