Difference between revisions of "SpaceAPI"

From Hackerspace ACKspace
Jump to: navigation, search
m (set to completed. Updates still might occur)
(major update (due to migration to MQTT and the official move of the public API website)
Line 8: Line 8:
 
== synopsis ==
 
== synopsis ==
 
Expose hackerspace information via a <abbr title="JavaScript Object Notation">JSON</abbr> structure.
 
Expose hackerspace information via a <abbr title="JavaScript Object Notation">JSON</abbr> structure.
See [https://spaceapi.net/ spaceapi.net] for details.
+
See [https://spaceapi.io/docs/ spaceapi.io] for documentation (or its [http://spaceapi.net/ old site (unsecure)]).
  
 
== current version ==
 
== current version ==
 
The current backend has been made modular for easy maintenance and feature expansion.
 
The current backend has been made modular for easy maintenance and feature expansion.
The first implemented expansion is temperature sensors.
+
Several expansions are already in place:
 +
* temperature
 +
* [https://ackspace.nl/spaceAPI/geo.php geo location] for [[Hackers on a Bike]]
 +
* [https://ackspace.nl/spaceAPI/statechanges.html heatmap] (also [https://mapall.space/heatmap//show.php?id=ACKspace externally here])
 +
* [https://ackspace.nl/spaceAPI/conference.html teleconference status]
 +
* [https://ackspace.nl/spaceAPI/services.html services status]
 +
* [https://ackspace.nl/spaceAPI/audit.html stock supply]
  
Most of the latest implementation has been done by [[user:Da_Syntax|Da Syntax]] and [[User:Xopr|xopr]] (ask them for details).
+
Most of the first implementation has been done by [[user:Da_Syntax|Da Syntax]] and [[User:Xopr|xopr]] (ask them for details).
  
 
Currently, both the new and old system are running in parallel, but some things need to be done before deprecating the old system.
 
Currently, both the new and old system are running in parallel, but some things need to be done before deprecating the old system.
* Update the ackspace.nl/spacestate.php 'widget' which was used on [http://hackerspaces.nl/ hackerspaces.nl] (determine whether this can be removed completely)
+
 
* <s>ackspace.nl/status.php</s> now gives a 301 - moved permanently, which is needed because the open space directory of [http://spaceapi.net/directory.json spaceapi.net (JSON)] and its [[GitHub::https://github.com/SpaceApi/OpenSpaceDirectory|GitHub repo]] is outdated; it is superseded by '''[https://spaceapi.fixme.ch/directory.json fixme.ch (JSON)]''' with the latest revision on '''[[GitHub::https://github.com/fixme-lausanne/OpenSpaceDirectory|fixme-lausanne's GitHub repo]]'''
+
The active maintained SpaceAPI project is at [https://spaceapi.io spaceapi.io].
 +
* Directory is at https://directory.spaceapi.io/
 +
* A feature full API is at https://api.spaceapi.io/ (described at https://api.spaceapi.io/openapi.json )
 +
* The latest directory is at [https://raw.githubusercontent.com/SpaceApi/directory/master/directory.json github] but may contain automated problems at times
 +
* There is a cached directory at https://api.spaceapi.community/
 +
* There is a cached API at https://api.spaceapi.community/cache
 +
* The old maintained directory is at https://spaceapi.fixme.ch/directory.json with the [[GitHub::https://github.com/fixme-lausanne/OpenSpaceDirectory|fixme-lausanne's GitHub repo here]]
 +
* [http://hackerspaces.nl/ hackerspaces.nl] uses the SpaceAPI
  
 
Several systems are tied to the backend:
 
Several systems are tied to the backend:
Line 29: Line 42:
 
! category
 
! category
 
|-
 
|-
| [[Space state]] (switch)
+
| [[MQTT]] (bridge)
| hardware
+
| software
 
|
 
|
 
| [[Telephone_system:Space_state|Space state (telephone system)]]
 
| [[Telephone_system:Space_state|Space state (telephone system)]]
 
| software
 
| software
 
|-
 
|-
| [[ESP8266-SpaceState]]
+
| [[ESP8266-SpaceState]]<abbr title="obsolete">/!\</abbr>
 
| hardware, firmware
 
| hardware, firmware
 
|
 
|
Line 41: Line 54:
 
| hardware, firmware
 
| hardware, firmware
 
|-
 
|-
| [[Spacestate sensors]] <abbr title="incomplete">/!\</abbr>
+
| [[Spacestate sensors]] <abbr title="incomplete and obsolete">/!\</abbr>
 
| hardware, firmware
 
| hardware, firmware
 
|
 
|
Line 47: Line 60:
 
| hardware, firmware, software
 
| hardware, firmware, software
 
|-
 
|-
|
+
| [[Space state]] (switch)<abbr title="obsolete">/!\</abbr>
|
+
| hardware
 
|
 
|
 
| [[IRC ACKspace-statusbot]]
 
| [[IRC ACKspace-statusbot]]

Revision as of 13:48, 20 November 2021

Project: SpaceAPI
Featured: No
State Completed
Members Vicarious, Coolepascal, Prodigity, Da Syntax, xopr, stuiterveer
GitHub spaceAPI
Description HackerSpace Status API
Picture
No project picture! Fill in form Picture or Upload a jpeg here

synopsis

Expose hackerspace information via a JSON structure. See spaceapi.io for documentation (or its old site (unsecure)).

current version

The current backend has been made modular for easy maintenance and feature expansion. Several expansions are already in place:

Most of the first implementation has been done by Da Syntax and xopr (ask them for details).

Currently, both the new and old system are running in parallel, but some things need to be done before deprecating the old system.

The active maintained SpaceAPI project is at spaceapi.io.

Several systems are tied to the backend:

inputs category outputs category
MQTT (bridge) software Space state (telephone system) software
ESP8266-SpaceState/!\ hardware, firmware Spacestate indicator /!\ hardware, firmware
Spacestate sensors /!\ hardware, firmware Mobile Spacestate Indicator hardware, firmware, software
Space state (switch)/!\ hardware IRC ACKspace-statusbot software
SpaceAPIBot (Telegram) software
Pebble watch app software
Widget:SpaceAPI software

Affiliated github repositories:

Deprecated implementations:

todo

done

  • created database for space state (log) and sensor values
  • new php code online (currently running parallel with the old version)
  • created new space state hardware interface using the ESP8266 which connects to the same old switch
  • First draft after recovery esp8266-SpaceAPI-full.tar Note that the used JSON parser library will cause heap corruption.
  • front page widget is now a real widget
  • php backend source online

old version

  • Updated JSON object to become SpaceAPI 0.13 compliant (see status.php)
    • Content type and Cache-Control headers are now sent
    • Now uses location object
    • Now uses state object
    • Space state now has a third state; null. (In case of uncertain state)
  • Uploaded it to ackspace.nl/status.php but the URL can be changed if necessary..
  • From the SpaceAPI website: "In order to be able to retrieve the object from within a javascript sandbox, the server of the JSON object should set the ‘Access-Control-Allow-Origin’ header with a value of ‘*’ ".
  • Added the JSON object to the existing Space state PHP script. Thanks CoolePascal for the help with the PHP stuff!