Changes

Jump to: navigation, search

SpaceAPI

596 bytes added, 16:52, 2 May 2012
* A Drupal module to show the status on the main website
== Dummy script to lookup the status ==
 
<syntaxhighlight lang="python">
#!/usr/bin/env python2
import urllib
try:
import json
except ImportError:
import simplejson as json
 
URL = "https://fixme.ch/cgi-bin/spaceapi.py"
try:
con = urllib.urlopen(URL)
hs_json = json.load(con)
except IOError:
print("An error occured sorry")
exit(1)
if hs_json['open']:
print("OPENENENENEN")
print("status is : %(status)s" %hs_json)
print("the changes happens at %(lastchange)s" % hs_json)
print("The duration is %(duration)s hours" % hs_json)
else:
print("The hackerspace is closed")
<\syntaxhighlight>
== Participant ==
* [[User:Nemen]]
* [[User:Gcmalloc]]
* [[User:Rorist]]
445
edits