Skip to content

Commit

Permalink
feat(StreamEast): add presence (#8953)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dlunhappy226 authored Dec 26, 2024
1 parent 06056e8 commit 14eda59
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
23 changes: 23 additions & 0 deletions websites/S/StreamEast/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://schemas.premid.app/metadata/1.12",
"apiVersion": 1,
"author": {
"id": "697250122181902436",
"name": "dlunhappy226"
},
"service": "StreamEast",
"description": {
"en": "StreamEast is a free HD sports streaming platform."
},
"url": "the.streameast.app",
"version": "1.0.0",
"logo": "https://i.ibb.co/gr5gcV8/file.jpg",
"thumbnail": "https://i.ibb.co/TRTWLnT/ACE-Takes-Down-Meth-Streams-Clones3.jpg",
"color": "#E10601",
"category": "videos",
"tags": [
"video",
"streaming",
"sports"
]
}
69 changes: 69 additions & 0 deletions websites/S/StreamEast/presence.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
const presence = new Presence({
clientId: "1316661139672797236",
}),
browsingTimestamp = Math.floor(Date.now() / 1000);

presence.on("UpdateData", async () => {
const presenceData: PresenceData = {
largeImageKey: "https://i.ibb.co/gr5gcV8/file.jpg",
startTimestamp: browsingTimestamp,
},
{ pathname } = document.location;

switch (pathname) {
case "/v85": {
presenceData.details = "Viewing home page";
break;
}
case "/nflstreams5": {
presenceData.details = "Viewing NFL streams";
break;
}
case "/nba/streams4": {
presenceData.details = "Viewing NBA streams";
break;
}
case "/nhl/streams2": {
presenceData.details = "Viewing NHL streams";
break;
}
case "/cfb/streams2": {
presenceData.details = "Viewing CFB streams";
break;
}
case "/ncaab/streams": {
presenceData.details = "Viewing NCAAB streams";
break;
}
case "/boxingstreams13": {
presenceData.details = "Viewing Boxing streams";
break;
}
case "/mmastreams10": {
presenceData.details = "Viewing MMA streams";
break;
}
case "/f1/streams": {
presenceData.details = "Viewing F1 streams";
break;
}
case "/multi-stream": {
presenceData.details = "Watching multiple streams";
break;
}
default:
if (pathname.includes("/blog/"))
presenceData.details = `Viewing blog: ${document.title}`;
else if (document.title.includes("vs")) {
presenceData.details = `Watching: [${pathname
.match(/^\/([^/]+)\//)[1]
.toUpperCase()}] ${document.title.replace(
" Live Stream - StreamEast",
""
)}`;
}
}

if (presenceData.details) presence.setActivity(presenceData);
else presence.setActivity();
});

0 comments on commit 14eda59

Please sign in to comment.