Permalink
Browse files

SpaceAPI, as per http://hackerspaces.nl/spaceapi/

  • Loading branch information...
1 parent 29c4fcc commit 316805fc70382a0be99aeb52e8236e1429c8e8f2 @dannyob committed Dec 17, 2011
Showing with 30 additions and 0 deletions.
  1. +4 −0 README.md
  2. +3 −0 apache2-conf
  3. +23 −0 api.py
View
@@ -23,6 +23,10 @@ For instance, to open the door using curl:
Returns 'hello [name]'
+### GET /spaceapi/
+
+Returns Noisebridge status, formatted as per http://hackerspaces.nl/spaceapi/
+
### GET /gate/
Gets interesting stats about the gate. Currently:
View
@@ -12,4 +12,7 @@
Allow from 75.101.62.89
Allow from 127.0.0.1
</Directory>
+ <Location /spaceapi/>
+ All from all
+ </Location>
</VirtualHost>
View
23 api.py
@@ -19,6 +19,7 @@
api_app = Bottle()
import socket
+import time
def chat_with_gate(message):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@@ -61,6 +62,28 @@ def gate_open():
def gate_status():
return { 'ringing' : is_gate_ringing() }
+@api_app.route("/spaceapi/")
+def spaceapi():
+ return { 'api' : '0.11'
+ , 'space' : 'Noisebridge'
+ , 'logo' : 'https://www.noisebridge.net/NB-logo-red-black-med.png'
+ , 'icon' :
+ { 'open' : 'https://www.noisebridge.net/images/9/9b/Nb-open-100x100.png'
+ , 'closed' : 'https://www.noisebridge.net/images/9/9b/Nb-open-100x100.png' }
+ , 'url' : 'https://www.noisebridge.net/'
+ , 'address' : '2169 Mission Street, San Francisco, CA 94110-1219, United States of America'
+ , 'contact' :
+ {
+ 'irc' : 'irc://irc.freenode.net/#noisebridge'
+ , 'twitter' : '@noisebridge'
+ , 'ml' : 'noisebridge-discuss@noisebridge.net'
+ , 'email' : 'secretary@noisebridge.net' }
+ , "lat": 37.762376
+ , "lon": -122.419217
+ , 'open' : True
+ , 'status' : 'open for public -- just ring the buzzer'
+ , 'lastchange' : time.time() - 1222819200
+ }
def main(args):
if DEBUG:

0 comments on commit 316805f

Please sign in to comment.