Skip to content

Instantly share code, notes, and snippets.

@Kenya-West
Created February 10, 2023 12:08
Show Gist options
  • Save Kenya-West/3e425b31d379d3776b17e261b0cce8e3 to your computer and use it in GitHub Desktop.
Save Kenya-West/3e425b31d379d3776b17e261b0cce8e3 to your computer and use it in GitHub Desktop.
Get members of current selected feed in Telegram Web Z
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