projets:fuz:spaceapi
This is an old revision of the document!
Table of Contents
SpaceAPI
Project information
Goals
- serve a SpaceAPI endpoint at https://spaceapi.fuz.re
- set the opening status according to the presence button API at https://presence.fuz.re/api
- add it to the directory so we can have nice opening stats at https://spaceapi.vanheusden.com/ and other great goodies (we could finally have the opening state on the wiki: https://github.com/HackspaceJena/hackspace-status-dokuwiki-plugin, via https://www.binary-kitchen.de/wiki/doku.php?do=edit!)
Resources
Log
2020-10-17 (in the previous night)
Functional and valid (curl -X POST -H "Content-Type: application/json" https://validator.spaceapi.io/v2/validateJSON -d "$(curl -s localhost:8080)"
) API in Go, to be published on Github
2020-10-17 (in the evening)
Pushed to GH, made the app configurable via env variable, deployed on sonic by following what I (Lomanic) did during the Online Fuzturday #1.
To be run with
SPACEAPI='{"api":"0.13","space":"FUZ","logo":"https://fuz.re/WWW.FUZ.RE_fichiers/5c02b2a84373a.png","url":"https://fuz.re/","location":{"address":"11-15 rue dela Réunion, Paris 75020, FRANCE","lon":2.40308,"lat":48.85343},"contact":{"email":"","irc":"","ml":"fuz@fuz.re","twitter":"@fuz_re","matrix":"https://matrix.to/#/#fuz_general:matrix.fuz.re"},"issue_report_channels":["ml","twitter"],"state":{"icon":{"open":"https://presence.fuz.re/img","closed":"https://presence.fuz.re/img"},"message":"open under conditions: https://wiki.fuz.re/doku.php?id=map"},"projects":["https://wiki.fuz.re/doku.php?id=projets:fuz:start"]}' PRESENCEAPI=https://presence.fuz.re/api go run main.go
Example of served JSON:
{ "api": "0.13", "space": "FUZ", "logo": "https://fuz.re/WWW.FUZ.RE_fichiers/5c02b2a84373a.png", "url": "https://fuz.re/", "location": { "address": "11-15 rue de la Réunion, Paris 75020, FRANCE", "lon": 2.40308, "lat": 48.85343 }, "contact": { "email": "", "irc": "", "ml": "fuz@fuz.re", "twitter": "@fuz_re", "matrix": "https://matrix.to/#/#fuz_general:matrix.fuz.re" }, "issue_report_channels": [ "ml", "twitter" ], "state": { "icon": { "open": "https://presence.fuz.re/img", "closed": "https://presence.fuz.re/img" }, "open": false, "message": "open under conditions: https://wiki.fuz.re/doku.php?id=map", "lastchange": 1602942506 }, "projects": [ "https://wiki.fuz.re/doku.php?id=projets:fuz:start" ] }
projets/fuz/spaceapi.1602961251.txt.gz · Last modified: 2023-02-02 22:06 (external edit)