initial logic
This commit is contained in:
parent
961cb51a9d
commit
8e74563350
27
printFollowerCount.js
Normal file
27
printFollowerCount.js
Normal file
@ -0,0 +1,27 @@
|
||||
// i85zmo3j i85zmo3j
|
||||
|
||||
let followerClass = prompt('Enter the class for followers')
|
||||
console.log(followerClass)
|
||||
|
||||
function getfollowers() {
|
||||
return document.querySelectorAll(`.${followerClass}`).length
|
||||
}
|
||||
function scrollAndGetFollowers() {
|
||||
window.scrollTo(0, document.body.scrollHeight);
|
||||
return getfollowers();
|
||||
}
|
||||
|
||||
// setTimeout(() => { scrollAndGetFollowers() }, 2000);
|
||||
|
||||
let continuePrinting = true;
|
||||
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key=="s") {
|
||||
continuePrinting = false;
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
setInterval(() => {
|
||||
console.log(`This user has ${scrollAndGetFollowers()} followers!`)
|
||||
}, 10000);
|
||||
Loading…
Reference in New Issue
Block a user