Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
Signed-off-by: moyaimoment <51049688+moyaimoment@users.noreply.github.com>
  • Loading branch information
moyaimoment authored Nov 30, 2024
1 parent b79f6a7 commit b7d1d7d
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions websites/C/Club Penguin Journey/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@ const presence = new Presence({
browsingTimestamp = Math.floor(Date.now() / 1000);

presence.on("UpdateData", async () => {
const presenceData: PresenceData = {
largeImageKey: "https://i.imgur.com/2MUm0oA.jpeg",
startTimestamp: browsingTimestamp,
};
const presenceData: PresenceData = {
largeImageKey: "https://i.imgur.com/2MUm0oA.jpeg",
startTimestamp: browsingTimestamp,
};

switch (document.location.hostname) {
case "cpjourney.net": {
if (document.location.pathname === "/") {
presenceData.details = "Waddling around";
presenceData.state = "Viewing Home";
} else if (document.location.pathname.startsWith("/news/")) {
presenceData.details = "Reading post:";
presenceData.state =
document.querySelector(".post_title__MNhEJ").textContent;
} else if (document.location.pathname.startsWith("/news")) {
presenceData.details = "Waddling around";
presenceData.state = "Scrolling through the news";
} else presenceData.details = "Waddling around";
break;
}
case "play.cpjourney.net":
{
if (document.location.pathname === "/") {
presenceData.details = "Waddling around";
presenceData.state = "Playing Club Penguin Journey";
}
}
break;
}
switch (document.location.hostname) {
case "cpjourney.net": {
if (document.location.pathname === "/") {
presenceData.details = "Waddling around";
presenceData.state = "Viewing Home";
} else if (document.location.pathname.startsWith("/news/")) {
presenceData.details = "Reading post:";
presenceData.state =
document.querySelector(".post_title__MNhEJ").textContent;
} else if (document.location.pathname.startsWith("/news")) {
presenceData.details = "Waddling around";
presenceData.state = "Scrolling through the news";
} else presenceData.details = "Waddling around";
break;
}
case "play.cpjourney.net":
{
if (document.location.pathname === "/") {
presenceData.details = "Waddling around";
presenceData.state = "Playing Club Penguin Journey";
}
}
break;
}

presence.setActivity(presenceData);
presence.setActivity(presenceData);
});

0 comments on commit b7d1d7d

Please sign in to comment.