-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(StreamEast): add presence (#8953)
- Loading branch information
1 parent
06056e8
commit 14eda59
Showing
2 changed files
with
92 additions
and
0 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 |
---|---|---|
@@ -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" | ||
] | ||
} |
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 |
---|---|---|
@@ -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(); | ||
}); |