From 8e745633509d1c25ad01462c95b8fe2a013ceda9 Mon Sep 17 00:00:00 2001 From: Pavak Paul Date: Mon, 29 Aug 2022 03:29:12 +0530 Subject: [PATCH] initial logic --- printFollowerCount.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 printFollowerCount.js diff --git a/printFollowerCount.js b/printFollowerCount.js new file mode 100644 index 0000000..42bf3f7 --- /dev/null +++ b/printFollowerCount.js @@ -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); \ No newline at end of file