Skip to content

Instantly share code, notes, and snippets.

@Hans5958
Created June 6, 2020 13:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hans5958/007c47112c4510856c1a642a32aa2964 to your computer and use it in GitHub Desktop.
Save Hans5958/007c47112c4510856c1a642a32aa2964 to your computer and use it in GitHub Desktop.
A script for unblocking everyone on Twitter. Modified from https://lucahammer.com/2018/08/09/unblock-all-blocked-twitter-accounts-at-once/.
if (document.querySelector("h1.css-901oao > span:nth-child(1)")) {
document.location.reload()
}
console.clear()
console.log("Script loaded!\n\nLoading...")
window.scrollBy(0, window.innerHeight)
var blockedNow = []
var totalUnblocked = 0
autoUnblock = setInterval(() => {
blockedNow = []
window.scrollBy(0, window.innerHeight)
document.querySelectorAll('[aria-label="Blocked"]').forEach(account => {
account.click()
try {account.parentElement.parentElement.children[1].outerHTML = ""} catch(e) {}
try {account.parentElement.parentElement.parentElement.firstChild.outerHTML = ""} catch(e) {}
setTimeout(() => account.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.outerHTML = "", 20000)
blockedNow.push(account.parentElement.firstChild.firstChild.firstChild.children[1].textContent.slice(1))
});
console.clear()
totalUnblocked += blockedNow.length
if (blockedNow.length) console.log(`Now unblocked ${blockedNow.length} accounts.\nA total of ${totalUnblocked} accounts have been unblocked.\n\n${blockedNow.join(", ")}\n\nLoading...`)
else console.log(`No unblocked accounts now.\nA total of ${totalUnblocked} accounts have been unblocked.\n\nLoading...`)
if (document.querySelector("h1.css-901oao > span:nth-child(1)")) {
console.log("Bail out!")
clearInterval(autoUnblock)
}
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment