Skip to content

Commit

Permalink
Merge pull request PreMiD#3055 from QkeleQ10/master
Browse files Browse the repository at this point in the history
Overhaul JUKE.nl presence, Update Magister presence
  • Loading branch information
mergify[bot] authored Feb 21, 2021
2 parents 5c3f901 + 5bb5a71 commit 25a09c9
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 17 deletions.
25 changes: 18 additions & 7 deletions websites/J/JUKE/dist/metadata.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
{
"author": {
"name": "STEPHAN",
"id": "183233556150091776"
"name": "QkeleQ10",
"id": "807917674477649943"
},
"contributors": [
{
"name": "STEPHAN",
"id": "183233556150091776"
}
],
"service": "JUKE",
"description": {
"en": "JUKE is a dutch radio channel collection site. JUKE is a Talpa Network Company.",
"en": "JUKE is a Dutch radio channel collection site. JUKE is a Talpa Network company.",
"nl": "JUKE is een verzamelingssite voor radiostations. JUKE is een merk van Talpa Network."
},
"url": "juke.nl",
"version": "1.2.5",
"logo": "https://i.imgur.com/Rh4L1UQ.png",
"thumbnail": "https://i.imgur.com/yHG4Vyg.png",
"version": "2.0.0",
"logo": "https://i.imgur.com/axm6M00.png",
"thumbnail": "https://i.imgur.com/kVj50nG.png",
"color": "#38af85",
"tags": [
"juke",
"talpa",
"radio",
"music",
"radio"
"muziek",
"free",
"gratis"
],
"category": "music"
}
43 changes: 36 additions & 7 deletions websites/J/JUKE/presence.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,41 @@
var presence = new Presence({
clientId: "629751665242669056"
const presence = new Presence({
clientId: "811305223783448627"
});

presence.on("UpdateData", async () => {
const testPresenceData: PresenceData = {
details: "Luister radio op juke.nl",
state: "Browsen...",
largeImageKey: "juke-large"
const presenceData: PresenceData = {
largeImageKey: "juke-crown",
buttons: [{ label: "Radio luisteren", url: document.location.href }]
};
presence.setActivity(testPresenceData);

if (document.querySelector("span[class*=eC-title]")) {
presenceData.details = document.querySelector("span[class*=eC-title]").innerHTML.replace("De ", "de ").replace("Het ", "het ").replace("&", "&");
if (document.querySelector("span[class*=eC-subtitle]")) {
presenceData.state = document.querySelector("span[class*=eC-subtitle]").innerHTML.replace("De ", "de ").replace("Het ", "het ").replace("&", "&");
}
}

if (!presenceData.details) {
presenceData.details = "Bladert op JUKE.nl";
presenceData.state = `Pagina '${document.title.replace(" |", "|").split("|")[0].replace("JUKE - Luister nu jouw favoriete radiozenders, non-stop muziek en podcasts!", "Home")}'`;
}

if (document.querySelector("rect")) {
presenceData.smallImageKey = "playing";
presenceData.smallImageText = "Wordt afgespeeld";
presenceData.buttons = [{ label: "Ook radio luisteren", url: document.location.href }];
} else if (document.querySelector("[class*=spinner]")) {
presenceData.smallImageKey = "waiting";
presenceData.smallImageText = "Wordt geladen";
} else if (document.querySelector("polygon")) {
presenceData.smallImageKey = "paused";
presenceData.smallImageText = "Gepauzeerd";
}

if (presenceData.details == null) {
presence.setTrayTitle();
presence.setActivity();
} else {
presence.setActivity(presenceData);
}
});
6 changes: 3 additions & 3 deletions websites/M/Magister/dist/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schemas.premid.app/metadata/1.0",
"author": {
"name": "106926",
"name": "QkeleQ10",
"id": "807917674477649943"
},
"url": "magister.net",
Expand All @@ -10,9 +10,9 @@
"en": "Magister 6 is a popular student information system in the Netherlands.",
"nl": "Magister 6 is een populair leerlingvolgsysteem in Nederland."
},
"version": "1.0.2",
"version": "1.0.3",
"service": "Magister",
"logo": "https://i.imgur.com/1TtM9A1.png",
"logo": "https://i.imgur.com/jk4XMSO.png",
"thumbnail": "https://i.imgur.com/TVjDmC4.png",
"color": "#1F97F9",
"tags": [
Expand Down

0 comments on commit 25a09c9

Please sign in to comment.