status -> state, cache-control

JSON compliant to the specs 0.13, 0.12, 0.11, 0.9, 0.8 spaceapi
This commit is contained in:
Pavel Ruzicka 2013-06-10 22:13:18 +03:00
parent 3aecb5f7c5
commit dfaa084f1b

View file

@ -325,7 +325,7 @@ sub register {
sub disable_caching {
my ($response) = @_;
$response->push_header("Cache-Control", "no-cache, must-revalidate");
$response->push_header("Cache-Control", "no-cache");
$response->push_header("Expires", "Sat, 26 Jul 1997 05:00:00 GMT");
}
@ -427,50 +427,50 @@ sub web_brmstatus_json {
$response->content(<<EOT
{
"api": "0.13",
"space": "brmlab",
"logo": "http://brmlab.cz/_media/brmlab.png?w=256",
"url": "http://brmlab.cz",
"location": {
"lat": 50.0984614,
"lon": 14.4369158,
"address": "Bubenska 1477/1, 170 00 Praha 7, Czech republic"
},
"address": "Bubenska 1477/1, 170 00 Praha 7, Czech republic",
"stream": {
"mpeg": "http://brmlab.cz/stream.flv"
},
"api": "0.13",
"space": "brmlab",
"logo": "http://brmlab.cz/_media/brmlab.png?w=256",
"url": "http://brmlab.cz",
"location": {
"lat": 50.0984614,
"lon": 14.4369158,
"address": "Bubenska 1477/1, 170 00 Praha 7, Czech republic"
},
"address": "Bubenska 1477/1, 170 00 Praha 7, Czech republic",
"stream": {
"mpeg": "http://brmlab.cz/stream.flv"
},
"open":${\($status ? 'true' : 'false')},
"lastchange":$laststchange,
"state": {
"open":${\($status ? 'true' : 'false')},
"lastchange":$laststchange,
"status": {
"open":${\($status ? 'true' : 'false')},
"lastchange":$laststchange,
"message": "open",
"icon": {
"open": "https://brmlab.cz/status-open-icon.png",
"closed": "https://brmlab.cz/status-closed-icon.png"
}
},
"message": ${\($status ? 'true' : 'false')},
"icon": {
"open": "https://brmlab.cz/status-open-icon.png",
"closed": "https://brmlab.cz/status-closed-icon.png"
},
"contact": {
"phone": "+420608801582",
"twitter": "\@brmlab",
"ml": "brmlab\@brmlab.cz",
"issue-mail": "rada\@brmlab.cz",
"irc": "irc://freenode/#brmlab",
"facebook": "brmlab"
},
"issue-report-channels": [
"issue-mail"
],
"open": "https://brmlab.cz/status-open-icon.png",
"closed": "https://brmlab.cz/status-closed-icon.png"
}
},
"icon": {
"open": "https://brmlab.cz/status-open-icon.png",
"closed": "https://brmlab.cz/status-closed-icon.png"
},
"contact": {
"phone": "+420608801582",
"twitter": "\@brmlab",
"ml": "brmlab\@brmlab.cz",
"issue-mail": "rada\@brmlab.cz",
"irc": "irc://freenode/#brmlab",
"feeds": [
{ "name": "blog", "type": "application/rss+xml", "url": "http://soup.brmlab.cz/rss" }
"facebook": "brmlab"
},
"issue-report-channels": [
"issue-mail"
],
"irc": "irc://freenode/#brmlab",
"feeds": [
{ "name": "blog", "type": "application/rss+xml", "url": "http://soup.brmlab.cz/rss" }
]
}
}
EOT
);