Skip to content

Instantly share code, notes, and snippets.

@ljaviertovar
Last active September 1, 2021 14:47
Show Gist options
  • Save ljaviertovar/b1574d5a47b71b6d94c13f6fb3d2fe0c to your computer and use it in GitHub Desktop.
Save ljaviertovar/b1574d5a47b71b6d94c13f6fb3d2fe0c to your computer and use it in GitHub Desktop.
Script to follow profiles in Medium
/*
* 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