Skip to content

Instantly share code, notes, and snippets.

@husnulhamidiah
Last active December 9, 2020 14:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save husnulhamidiah/8cc4b8fbc560e23096c059155917e1a1 to your computer and use it in GitHub Desktop.
Save husnulhamidiah/8cc4b8fbc560e23096c059155917e1a1 to your computer and use it in GitHub Desktop.
Auto Accept Instagram Following Request Script
/**
1. Open https://www.instagram.com/accounts/activity?followRequests=1
2. Open console and paste this code
Refs: https://stackoverflow.com/q/10351658
**/
function findButtonByTextContent(text) {
var result = []
var buttons = document.querySelectorAll('button');
for (var i=0, l=buttons.length; i<l; i++) {
if (buttons[i].firstChild.nodeValue == text)
result.push(buttons[i])
}
return result
}
function autoClick(text, interval) {
var buttons = findButtonByTextContent(text)
buttons.forEach(function(button, index) {
setTimeout(function timer() {
button.click()
}, index * interval)
})
}
autoClick('Confirm', 2500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment