Browse Source

add space api

encrypt 8 years ago
parent
commit
9198575cf0
1 changed files with 21 additions and 0 deletions
  1. 21 0
      webapp.rb

+ 21 - 0
webapp.rb

@@ -48,6 +48,27 @@ get '/hacklabbo/state.json' do
   state.to_json
 end
 
+get '/hacklabbo/space.json' do
+  content_type :json
+  {
+    api: "0.13",
+    space: "hacklabbo",
+    logo: "http://thecatapi.com/api/images/get?format=src&type=jpg",
+    url: "https://hacklabbo.indivia.net",
+    location: {
+      address: "XM24, Via Aristotile Fioravanti 24, Bologna",
+      lat: 44.512243,
+      lon: 11.341099
+    },
+    contact: {
+      ml: "hacklabbo@indivia.net"
+    },
+    state: {
+      open: state[:open]
+    }
+  }.to_json
+end
+
 get '/hacklabbo/open/:token' do |token|
   if token == settings.secret_token
     entry = Entry.create(open: true, date: DateTime.now)