Last active
September 1, 2021 14:47
-
-
Save ljaviertovar/b1574d5a47b71b6d94c13f6fb3d2fe0c to your computer and use it in GitHub Desktop.
Script to follow profiles in Medium
This file contains 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
/* | |
* First step, find the people you want to follow | |
* Second step, run the following script in the page inspector console | |
*/ | |
// get all profiles displayed | |
const allprofiles = Array.from(document.querySelectorAll('.js-followButton')); | |
// return all profiles no following yet | |
const newprofiles = allprofiles.filter((profile) => { | |
return !profile.classList.contains('is-active') | |
}) | |
(async function loop() { | |
let count = 0; | |
for (let profile of newprofiles) { | |
if(count <= 100){ | |
await delay(1000); | |
profile.click(); | |
count++; | |
console.log('profile clicked', count); | |
} | |
} | |
})(); | |
// function to sleep | |
const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment