Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making the spaceapi compliant to the new 0.13 specification #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def getdata(status, messages)
(statusS.zip status).each do |d, dPrev|
if d != nil and dPrev != nil
if d['door_open'] != dPrev['door_open']
start = d['timestamp'] + " UTC"
start = Time.parse(d['timestamp'] + "UTC")
@duration = Time.diff(Time.now(), start, '%h:%m')[:diff]
break
end
Expand Down Expand Up @@ -153,7 +153,7 @@ def getdata(status, messages)
if d != nil and dPrev != nil
if d['door_open'] != dPrev['door_open']
start = d['timestamp']
@lastchange = Time.parse(start + " UTC").to_i
@lastchange = Time.parse(start + "UTC").localtime.strftime("%s").to_i
break
end
end
Expand All @@ -166,8 +166,8 @@ def getdata(status, messages)
end

json = YAML.load_file('status.yml')
json[:open] = @open
json[:lastchange] = @lastchange
json['state'][:open]= @open
json['state'][:lastchange] = @lastchange

content_type 'application/json'
jsonp json
Expand Down
30 changes: 16 additions & 14 deletions status.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
api: "0.12"
api: "0.13"
space: MetaMeute
url: https://metameute.de
icon:
open: http://status.metameute.de/images/open.png
closed: http://status.metameute.de/images/closed.png
address: Unversität zu Lübeck, Gebäude 62, Ratzeburger Allee 160, 23562 Lübeck, Germany
state:
icon:
open: http://status.metameute.de/images/open.png
closed: http://status.metameute.de/images/closed.png
contact:
phone: "+494515005011"
ml: [email protected]
email: [email protected]
ml: [email protected]
irc: irc://irc.oftc.net/#Metameute
logo: http://status.metameute.de/images/logo.png
feeds:
- name: blog
type: application/rss+xml
url: http://blog.metameute.de/feed/
- name: status
type: application/rss+xml
url: http://status.metameute.de/rss
lat: 53.834372
lon: 10.702268
blog:
type: application/rss+xml
url: http://blog.metameute.de/feed/
issue_report_channels:
- email
location:
lat: 53.834372
lon: 10.702268
address: Unversität zu Lübeck, Gebäude 62, Ratzeburger Allee 160, 23562 Lübeck, Germany
2 changes: 1 addition & 1 deletion views/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
</ul>

<footer>
<a href="https://github.com/MetaMeute/metameutestatus">Source Code</a> //
<a href="https://github.com/MetaMeute/metameutestatus">Source Code</a> //
<a href="<%= url('/rss') %>">RSS</a>
</footer>