Skip to content

Instantly share code, notes, and snippets.

@ronaiza-cardoso
Last active October 18, 2018 12:45
Show Gist options
  • Save ronaiza-cardoso/1b5e6b18173672e32288172707ad1ca4 to your computer and use it in GitHub Desktop.
Save ronaiza-cardoso/1b5e6b18173672e32288172707ad1ca4 to your computer and use it in GitHub Desktop.
go to your instagram page > open your fallow list with > open inspect > toggle device tollbar > paste this on console > run and see the magic happens
// I've got inspired by this code: https://github.com/pbradaric/instagram-unfollow-script
var ufwTotalCounter = 0;
var ufwCounter = 0;
var maxUfwsPerBatch = 13;
var fwButtonSelector = document.getElementsByClassName('_5f5mN')
var length = fwButtonSelector.length - 1 === -1 ? 0 : fwButtonSelector.length - 1
var delayBetweenUfwClicks = 4000;
var delayRandomness = 4000;
var delayBetweenUfwBatches = 600000;
var person = '';
var scrollingElement = (document.scrollingElement || document.body);
console.log(fwButtonSelector[length].textContent === 'Following');
function unfollow() {
var delay = 5000;
if (ufwCounter < maxUfwsPerBatch) {
console.log('UNFOLLOW BUTTON ===> ', fwButtonSelector[length])
console.log('length ===> ', length)
if (length) {
console.log(fwButtonSelector[length].textContent === 'Following');
if (fwButtonSelector[length].textContent === 'Following') {
fwButtonSelector[length].click();
ufwCounter++;
ufwTotalCounter++;
length--;
person = ufwTotalCounter === 1 ? 'person' : 'persons'
console.log(`Unfollowed ${ufwTotalCounter} ${person}`);
} else {
scrollingElement.scrollTop = scrollingElement.scrollHeight;
fwButtonSelector = document.getElementsByClassName('_5f5mN')
length = fwButtonSelector.length - 1 === -1 ? 0 : fwButtonSelector.length - 1
console.log("No more 'Follow' buttons. Scrolling down.");
}
} else {
scrollingElement.scrollTop = scrollingElement.scrollHeight;
fwButtonSelector = document.getElementsByClassName('_5f5mN')
length = fwButtonSelector.length - 1 === -1 ? 0 : fwButtonSelector.length - 1
console.log("No more 'Follow' buttons. Scrolling down.");
}
delay = Math.random() * delayRandomness + delayBetweenUfwClicks;
} else {
ufwCounter = 0;
delay = delayBetweenUfwBatches;
console.log("Pausing with execution for " + delay/1000 + " seconds...");
}
setTimeout(function() {
unfollow();
}, delay);
}
unfollow()
@robalb
Copy link

robalb commented Jun 18, 2018

Cool. I suggest this to everyone trying to get shadow banned

@ronaiza-cardoso
Copy link
Author

Lol, me to!

@evertonmdz
Copy link

Thanks man! i change var delayBetweenUfwClicks = 4000; for 60000 and this number "_5f5mN" each has its own in each instagram account, you have to click on inspect the "following" button to see which is your own "_5f5mN"! At the moment yours is the only script in operation! the rest is blocked by using "Script.src"!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment