Made the API compliant with spec version 0.13

See http://spaceapi.net/specs/0.13 for the full spec
This commit is contained in:
Jan-Erik Rediger 2014-04-29 12:51:06 +02:00
parent b2a9df80c6
commit 8ece062adb
1 changed files with 24 additions and 10 deletions

View File

@ -1,25 +1,39 @@
<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json");
header("Cache-Control: no-cache");
$quelltext = file_get_contents("http://www.chaostreff-dortmund.de/raumstatus.php?txt");
$state = $quelltext == "online\n" ? "true" : "false";
?>
{
"api":"0.12",
"api":"0.13",
"space":"Chaostreff-Dortmund",
"logo":"https://wiki.ctdo.de/lib/tpl/dokubook/images/ctdo.png",
"icon":{
"open":"http://www.chaostreff-dortmund.de/green.png",
"closed":"http://www.chaostreff-dortmund.de/red.png"
"open":"https://www.chaostreff-dortmund.de/green.png",
"closed":"https://www.chaostreff-dortmund.de/red.png"
},
"state": {
"open":<?php echo $state; ?>
},
"url":"https://www.chaostreff-dortmund.de/",
"address":"Braunschweigerstr. 22, 44145 Dortmund, Germany",
"contact":{
"irc":"irc://irc.hackint.org/#ccc.do",
"irc":"irc://irc.hackint.org/#ctdo",
"twitter":"@ctdo",
"email":"presse@chaostreff-dortmund.de",
"ml":"ccc@chaostreff-dortmund.de"
"ml":"discuss@lists.chaostreff-dortmund.de"
},
"lat":51.527664,
"lon":7.465072,
"open":<?php if($quelltext == "online\n") echo "true"; else echo "false";?>
"issue_report_channels": ["ml"],
"location": {
"address":"Braunschweigerstr. 22, 44145 Dortmund, Germany",
"lat":51.527664,
"lon":7.465072
},
"lat": 51.527664,
"lon": 7.465072,
"open": false
}