-
-
Save Metalhearf/329bc997f9bb762efc0e2aec9029bdc8 to your computer and use it in GitHub Desktop.
Untick all Twitter (X) ad recommendations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To untick all the "personalised interests" that are used for ad targeting on twitter | |
* you go to this page: https://twitter.com/settings/your_twitter_data/twitter_interests | |
* | |
* Go to the inspector and run this code and it should untick all the ticked boxes | |
* in the list. You need a delay or the twitter API thinks you're trying to overload it. | |
*/ | |
var checkboxes = []; | |
document.querySelectorAll('input[type="checkbox"]').forEach((c) => { | |
if(c.checked) { | |
checkboxes[checkboxes.length] = c; | |
} | |
}); | |
var i = 0; | |
var loopId = setInterval(() => { | |
var e = checkboxes[i++]; | |
if(i % 10 == 0) { console.log("Running... (" + i + ")")} // Should say on the Console where we're at. | |
if(e !== undefined) { | |
if(e.checked) { | |
console.log(e); | |
e.parentElement.click(); | |
} | |
} else { | |
clearInterval(loopId); | |
} | |
}, 5000); // seems to be a good interval to not overload the API and leave it running in the background. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment