forked from PreMiD/Presences
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request PreMiD#3055 from QkeleQ10/master
Overhaul JUKE.nl presence, Update Magister presence
- Loading branch information
Showing
3 changed files
with
57 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters