Skip to content

Instantly share code, notes, and snippets.

@ib0b
Created May 9, 2020 21:03
Show Gist options
  • Select an option

  • Save ib0b/f9c689208e1b53e2a12b27e75432bd99 to your computer and use it in GitHub Desktop.

Select an option

Save ib0b/f9c689208e1b53e2a12b27e75432bd99 to your computer and use it in GitHub Desktop.
Twitter Unfollow Script
var start = 1
var num = 100 + start
//go to your following page on any brower
//run in console
const sleep = time => new Promise(resolve => setTimeout(resolve, time))
async function unfollow() {
try {
for (var i = start; i < num; i++) {
if (document.querySelector("#react-root > div > div > div.css-1dbjc4n.r-18u37iz.r-13qz1uu.r-417010 > main > div > div > div > div > div > div:nth-child(2) > section > div > div > div:nth-child(" + i + ") > div > div > div > div.css-1dbjc4n.r-1iusvr4.r-16y2uox.r-5f2r5o > div > div.css-1dbjc4n.r-1n0xq6e > div > div > span > span").innerHTML != "Following") {
continue
}
document.querySelector("#react-root > div > div > div.css-1dbjc4n.r-18u37iz.r-13qz1uu.r-417010 > main > div > div > div > div > div > div:nth-child(2) > section > div > div > div:nth-child(" + i + ") > div > div > div > div.css-1dbjc4n.r-1iusvr4.r-16y2uox.r-5f2r5o > div > div.css-1dbjc4n.r-1n0xq6e > div > div > span > span").click()
document.querySelector("#react-root > div > div > div.r-1d2f490.r-u8s1d.r-zchlnj.r-ipm5af.r-184en5c > div:nth-child(2) > div > div > div > div.css-1dbjc4n.r-1awozwy.r-1kihuf0.r-18u37iz.r-1pi2tsx.r-1777fci.r-1pjcn9w.r-fxte16.r-1xcajam.r-ipm5af.r-9dcw1g > div.css-1dbjc4n.r-1awozwy.r-yfoy6g.r-t23y2h.r-1jgb5lz.r-pm9dpa.r-1ye8kvj.r-1rnoaur.r-d9fdf6.r-1sxzll1.r-13qz1uu > div.css-1dbjc4n.r-18u37iz.r-13qz1uu > div.css-18t94o4.css-1dbjc4n.r-urgr8i.r-42olwf.r-sdzlij.r-1phboty.r-rs99b7.r-16y2uox.r-1w2pmg.r-1vuscfd.r-1dhvaqw.r-1fneopy.r-o7ynqc.r-6416eg.r-lrvibr > div > span > span").click()
console.log("unfollow")
}
} catch (ex) {
let c = ex
}
window.scrollBy(0, 100000)
await sleep(2000)
unfollow()
}
unfollow()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment