-
-
Save joshbuchea/c44feb00f994b950048a6ed0fe55a60d to your computer and use it in GitHub Desktop.
Revisions
-
brunolemos revised this gist
May 13, 2020 . 1 changed file with 13 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,9 @@ } async function unfollowAll() { const buttons = getAllButtons(); for (let button of buttons) { count = count + 1; const name = button.parentElement.querySelector( @@ -21,5 +23,14 @@ } } async function run() { await unfollowAll(); window.scrollTo(0, document.body.scrollHeight); await new Promise((resolve) => setTimeout(resolve, 1000)); const buttons = getAllButtons(); if (buttons.length) run(); } run(); })(); -
brunolemos created this gist
May 13, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ (() => { let count = 0; function getAllButtons() { return document.querySelectorAll('button.is-following') || []; } async function unfollowAll() { for (let button of getAllButtons()) { count = count + 1; const name = button.parentElement.querySelector( '.follows-recommendation-card__name', ).innerText; console.log(`Unfollow #${count}:`, name); window.scrollTo(0, button.offsetTop - 260); button.click(); await new Promise((resolve) => setTimeout(resolve, 100)); } } unfollowAll(); })();