Created
February 10, 2023 12:08
-
-
Save Kenya-West/3e425b31d379d3776b17e261b0cce8e3 to your computer and use it in GitHub Desktop.
Get members of current selected feed in Telegram Web Z
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 characters
const namesList = new Set(); | |
let namesListDelta = 1; | |
let scrollingCounter = 0; | |
const scrollingCounterLimit = 10; | |
while(namesListDelta > 0 || scrollingCounter < scrollingCounterLimit) { | |
let delta = namesList.size; | |
const elems = document.querySelectorAll(".Transition.zoom-fade .Transition.slide-optimized .Transition__slide--active .chat-list .ListItem .info .info-row .title"); | |
const names = Array.from(elems).map((elem) => elem.innerText); | |
names.forEach((name) => namesList.add(name)); | |
namesListDelta = namesList.size - delta; | |
scrollingCounter++; | |
elems[elems.length-1].scrollIntoView(); | |
setTimeout(() => { | |
document.querySelector(".Transition.zoom-fade .Transition.slide-optimized .Transition__slide--active .chat-list").scrollTop = document.querySelector(".Transition.zoom-fade .Transition.slide-optimized .Transition__slide--active .chat-list").scrollHeight; | |
}, 1); | |
} | |
console.dir(Array.from(namesList)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment