Skip to content

Instantly share code, notes, and snippets.

@palant
Created November 6, 2019 10:58
Show Gist options
  • Save palant/43376d5442d71a4fb199f64ba53a1bfc to your computer and use it in GitHub Desktop.
Save palant/43376d5442d71a4fb199f64ba53a1bfc to your computer and use it in GitHub Desktop.
Mass-block users on Twitter
(async function()
{
let data = new URLSearchParams();
data.set("authenticity_token", document.getElementById("authenticity_token").value);
data.set("challenges_passed", "false");
data.set("handles_challenges", "1");
data.set("impression_id", "");
for (let element of document.getElementsByClassName("js-actionable-user"))
{
data.set("user_id", element.getAttribute("data-user-id"));
await fetch("https://twitter.com/i/user/block", {
method: "POST",
body: data,
headers: {
"X-Requested-With": "XMLHttpRequest",
"X-Twitter-Active-User": "yes"
}
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment