Created
February 10, 2019 01:40
-
-
Save leodutra/e1b6282b5a17ea29e18cf3ffbac134fd to your computer and use it in GitHub Desktop.
Instagram - auto unfollow
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 characters
| // open "following" on web browser | |
| async function main() { | |
| const buttons = document.querySelectorAll('button') | |
| for (let button of buttons) { | |
| if (button.textContent.trim().toLowerCase() === 'seguindo') { | |
| button.click() | |
| await wait(5000) | |
| const unfollowBtns = document.querySelectorAll('button') | |
| for (let x of unfollowBtns) { | |
| if (x.textContent.trim().toLowerCase() === 'deixar de seguir') { | |
| x.click() | |
| await wait(50) | |
| } | |
| } | |
| } | |
| } | |
| } | |
| async function wait(ms) { | |
| return new Promise(res => setTimeout(res, ms)) | |
| } | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment