Created
May 10, 2021 09:03
-
-
Save MrMarble/140d21d15e85c491ea809831bf7bfce9 to your computer and use it in GitHub Desktop.
Revisions
-
MrMarble created this gist
May 10, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ "use strict"; function getFollowed() { const dom = document.querySelector("div[aria-label='Canales que sigo']"); const key = Object.keys(dom).find((key) => key.startsWith("__reactInternalInstance$") ); const react = dom[key]; if (react == null) return; const walk = (obj, max = 30) => { if (obj.key === "FOLLOWED_SECTION") { return { offline: obj.memoizedProps.section.videoConnections, online: obj.memoizedProps.section.streams }; } if (--max > 0) return walk(obj.return); }; return walk(react); }