spaceAPI

by Niklaus 'vimja' Hofer on 2016-11-28

The impatient can find our spaceAPI here.

spaceAPI is an API to provide data on a hackerspace. Information such as the location of the hackerspace, the address of it's website, whether it's currently open or how warm it is inside the rooms can be retrieved through this means.

As is customary with APIs, spaceAPI is not supposed to provide information in human readable information but rather make the data accessible to machines. Developers can then write programs to process the information and / or display it to an end user in a formatted manner. With this approach it's not necessary for each hackerspace to write their own app and a user to install them all. Instead, a single app can be written which can then access and display the information from all hackerspaces - as long as they implement the API. There is already a number of applications - both native- and webapps - using the spaceAPI available.

To allow an application to find all the hackerspaces that implement the spaceAPI, there are directories - lists of the URL's for each hackerspace's spaceAPI. The Chaostreff Bern is currently listed in both the spaceAPI.net directory and the directory from FIXME Lausanne.

If you want to try out our spaceAPI yourself, it will be easiest to download the MyHackerspace app from the free F-Droid App-store. This app is developed by the FIXME Hackerspace in Lausanne who release it under the GPLv3 license.

The CCC has recently launched a spaceAPI based list of Chaostreffs and related Hackerspaces. It also features an aggregator of the calendars from all listed entities. Unfortunately, the Chaostreff Bern is not listed yet.

Even though the Chaostreff Bern is not actually a hackerspace, we do still have a room with a fixed address where we meet on a regular basis - information that can be expressed through the spaceAPI. Since our website is static, our implementation of the spaceAPI has to be static as well. In our case this means that we upload a simple JSON file onto our webserver. To display the open/closed status of the space, we have setup a cronjob that toggles the state on Tuesday evenings:

0 19 * * 2 sed -i -e 's/\t\t"open":.*$/\t\t"open": true,/g' /var/www/html/spaceapi.json
0 23 * * 2 sed -i -e 's/\t\t"open":.*$/\t\t"open": false,/g' /var/www/html/spaceapi.json