From 5f7544588eaa46b65c013588b7635b3a9b4621bd Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Sun, 12 May 2024 03:36:51 +0200 Subject: [PATCH] feat: adds spaceapi endpoint --- www/spaceapi.php | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 www/spaceapi.php diff --git a/www/spaceapi.php b/www/spaceapi.php new file mode 100644 index 0000000..be022af --- /dev/null +++ b/www/spaceapi.php @@ -0,0 +1,65 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + +$door = new \pvv\side\Door($pdo); +$doorEntry = (object)($door->getCurrent()); + +?> +{ + "api_compatibility": ["14"], + "space": "Programvareverkstedet", + "logo": "https://git.pvv.ntnu.no/Drift/pvv-nixos-config/raw/branch/main/assets/logo_blue_regular.png", + "url": "https://www.pvv.ntnu.no/", + "location": { + "address": "Sem Sælands vei 1, 7034 Trondheim, Norway", + "timezone": "Europe/Oslo", + "lon": 10.242, + "lat": 63.250 + }, + "contact": { + "irc": "//irc.pvv.ntnu.no/pvv", + "email": "pvv@pvv.ntnu.no", + "ext_discord": "https://discord.gg/8VTBr6Q", + "gopher": "gopher://isvegg.pvv.ntnu.no", + "matrix": "#pvv:pvv.ntnu.no" + }, + "issue_report_channels": ["email"], + "state": { + "open": open ? "true" : "false"); ?>, + "lastchange": time ? $doorEntry->time : 0); ?> + }, + "feeds": { + "wiki": { + "type": "atom", + "url": "https://www.pvv.ntnu.no/w/api.php?hidebots=1&urlversion=1&action=feedrecentchanges&feedformat=atom" + } + }, + "projects": [ + "https://github.com/Programvareverkstedet/", + "https://git.pvv.ntnu.no/", + "https://www.pvv.ntnu.no/prosjekt/" + ], + "links": [ + { + "name": "Events", + "url": "https://www.pvv.ntnu.no/hendelser/", + "description": "Upcoming events at Programvareverkstedet" + }, + { + "name": "YouTube", + "url": "https://www.youtube.com/@pvvntnu5640" + }, + { + "name": "LinkedIn", + "url": "https://www.linkedin.com/company/pvvntnu/" + }, + { + "name": "Facebook", + "url": "https://www.facebook.com/pvvntnu/" + } + ] +}