diff --git a/websites/P/PlanetXO/metadata.json b/websites/P/PlanetXO/metadata.json new file mode 100644 index 000000000000..a2105a004286 --- /dev/null +++ b/websites/P/PlanetXO/metadata.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schemas.premid.app/metadata/1.11", + "apiVersion": 1, + "author": { + "id": "850028897118584843", + "name": "kieranl29" + }, + "service": "PlanetXO", + "description": { + "en": "PlanetXO - Small Regional Radio Stations localised to regions of the UK." + }, + "url": [ + "planetxo.uk", + "blastradio.uk", + "xoradio.uk", + "panel.planetxo.uk", + "api.planetxo.uk", + "staff.planetxo.uk" + ], + "version": "1.0.0", + "logo": "https://cdn.kaneproductions.co.uk/art/PlanetXO/shortlogo.png", + "thumbnail": "https://cdn.kaneproductions.co.uk/art/PlanetXO/pxobanner.jpg", + "color": "#8c52ff", + "category": "other", + "tags": [ + "bot", + "discord", + "radio", + "online", + "hiring", + "socials", + "gossuip", + "news", + "hitstation", + "localised", + "uk", + "unitedkingdom", + "socialise", + "regulated", + "kaneproductions" + ] +} diff --git a/websites/P/PlanetXO/presence.ts b/websites/P/PlanetXO/presence.ts new file mode 100644 index 000000000000..ebdc65d9cd78 --- /dev/null +++ b/websites/P/PlanetXO/presence.ts @@ -0,0 +1,153 @@ +const presence = new Presence({ + clientId: "1260572178068406282", + }), + browsingTimestamp = Math.floor(Date.now() / 1000); + +presence.on("UpdateData", async () => { + const presenceData: PresenceData = { + largeImageKey: + "https://cdn.kaneproductions.co.uk/art/PlanetXO/shortlogo.png", + startTimestamp: browsingTimestamp, + }; + + if (document.location.hostname === "planetxo.uk") { + switch (document.location.href.split("/").slice(0, -1).join("/")) { + case "https://planetxo.uk": { + presenceData.details = "Viewing the map"; + break; + } + case "https://planetxo.uk/xoradio": { + presenceData.details = "Viewing XO Radio"; + presenceData.buttons = [ + { + label: "Listen Along!", + url: "https://planetxo.uk/xoradio", + }, + ]; + break; + } + case "https://planetxo.uk/panel/planetxo": { + presenceData.details = "Viewing the PlanetXO Global Panel"; + break; + } + case "https://planetxo.uk/panel/admin": { + presenceData.details = + "Viewing the PlanetXO System Administrator Panel"; + break; + } + case "https://planetxo.uk/blastradio": { + presenceData.details = "Viewing Blast Radio"; + presenceData.buttons = [ + { + label: "Listen Along!", + url: "https://planetxo.uk/blastradio", + }, + ]; + break; + } + case "https://planetxo.uk/qtfm": { + presenceData.details = "Viewing QTFM"; + presenceData.buttons = [ + { + label: "Listen Along!", + url: "https://planetxo.uk/qtfm", + }, + ]; + break; + } + case "https://planetxo.uk/lushradio": { + presenceData.details = "Viewing Lush Radio"; + presenceData.buttons = [ + { + label: "Listen Along!", + url: "https://planetxo.uk/lushradio", + }, + ]; + break; + } + case "https://planetxo.uk/everyradio": { + presenceData.details = "Viewing Every Radio"; + presenceData.buttons = [ + { + label: "Listen Along!", + url: "https://planetxo.uk/everyradio", + }, + ]; + break; + } + case "https://planetxo.uk/panel": { + presenceData.details = "Viewing PlanetXO Panel"; + presenceData.buttons = [ + { + label: "Join the Team?", + url: "https://planetxo.uk/vacancies.php", + }, + ]; + break; + } + case "https://planetxo.uk/panel/xoradio": { + presenceData.details = "Viewing the Panel for XO Radio"; + presenceData.buttons = [ + { + label: "Listen Along!", + url: "https://planetxo.uk/xoradio", + }, + ]; + break; + } + case "https://planetxo.uk/panel/blastradio": { + presenceData.details = "Viewing the Panel for Blast Radio"; + presenceData.buttons = [ + { + label: "Listen Along!", + url: "https://planetxo.uk/blastradio", + }, + ]; + break; + } + case "https://planetxo.uk/panel/qtfm": { + presenceData.details = "Viewing the Panel for QTFM"; + presenceData.buttons = [ + { + label: "Listen Along!", + url: "https://planetxo.uk/qtfm", + }, + ]; + break; + } + case "https://planetxo.uk/panel/lushradio": { + presenceData.details = "Viewing the Panel for Lush Radio"; + presenceData.buttons = [ + { + label: "Listen Along!", + url: "https://planetxo.uk/lushradio", + }, + ]; + break; + } + case "https://planetxo.uk/panel/everyradio": { + presenceData.details = "Viewing the Panel for Every Radio"; + presenceData.buttons = [ + { + label: "Listen Along!", + url: "https://planetxo.uk/everyradio", + }, + ]; + break; + } + default: + if (document.location.hostname === "planetxo.uk") + presenceData.details = "Viewing PlanetXO"; + break; + } + } + + if (document.location.hostname === "panel.planetxo.uk") + presenceData.details = "Viewing the Panel for PlanetXO"; + + if (document.location.hostname === "staff.planetxo.uk") + presenceData.details = "Viewing the Emails for PlanetXO"; + + if (presenceData.details) presence.setActivity(presenceData); + else presence.setActivity(); +});