Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
uncheck twitter interests
var timer=100;document.querySelectorAll("div > input[type='checkbox']:checked").forEach((interest) => {setTimeout(function(){interest.click()},timer);timer+=2000;});
@eviltester

This comment has been minimized.

Copy link
Owner Author

@eviltester eviltester commented Nov 25, 2019

If you just want code that you can paste into the console of your dev tools to deselect your Twitter interests then it is below (I paste it from a single line, but it is formatted here for readability and should work if copy and pasted) :

var timer=100;document.querySelectorAll(
"div > input[type='checkbox']:checked"
).forEach((interest) => {
setTimeout(function(){interest.click()},timer);timer+=2000;});

Instructions:

You will probably see some 500 errors in the console. You may need to wait a few minutes and repeat the script. Then revisit it a few hours later and may need to repeat the script again.

by default I've made the timer increment by 2 seconds because the payload grows everytime you uncheck an item. Feel free to amend the increment to match the current load and value you eperience on the site.

@TheMetalCode

This comment has been minimized.

Copy link

@TheMetalCode TheMetalCode commented Nov 25, 2019

You goddam hero! shakes fist at Twitter for assuming I'm deeply interested in every thing or person I have ever read a tweet about

In my experience I was getting consistent 500s that ultimately let to most of the checks sticking around upon refresh. Changing the interval from 100 to 1000 seemed to work better for me - not as many 500s, and the checks are actually gone at least for now.

@eviltester

This comment has been minimized.

Copy link
Owner Author

@eviltester eviltester commented Nov 25, 2019

@Amariithynar

This comment has been minimized.

Copy link

@Amariithynar Amariithynar commented Feb 25, 2020

I've tried this multiple times now, including by removing the line spacing... it just returns a new line saying "undefined" and does nothing when I hit enter to execute it. Am I doing something wrong, or has Twitter changed something?

@eviltester

This comment has been minimized.

Copy link
Owner Author

@eviltester eviltester commented Feb 25, 2020

I've tried this multiple times now, including by removing the line spacing... it just returns a new line saying "undefined" and does nothing when I hit enter to execute it. Am I doing something wrong, or has Twitter changed something?

Why I follow the instructions it shows 'undefined' and then the checkboxes on the GUI start unchecking - seems to be working fine for me.

@Amariithynar

This comment has been minimized.

Copy link

@Amariithynar Amariithynar commented Feb 25, 2020

@eviltester

This comment has been minimized.

Copy link
Owner Author

@eviltester eviltester commented Feb 25, 2020

All it does is find all the checkboxes that are checked then loops over them and clicks them.

If:

document.querySelectorAll("div > input[type='checkbox']:checked")

returns an array of elements then something is going wrong with the click on your browser.

If it doesn't return an array of elements then either nothing is checked or the html on your GUI of Twitter is different and the selector doesn't match your GUI.

I have only tried this in Chrome.

@TheMetalCode

This comment has been minimized.

Copy link

@TheMetalCode TheMetalCode commented Feb 28, 2020

It's been working for me in Firefox, FYI

@eviltester

This comment has been minimized.

Copy link
Owner Author

@eviltester eviltester commented Feb 28, 2020

Thanks Jason :)

@Amariithynar

This comment has been minimized.

Copy link

@Amariithynar Amariithynar commented Feb 28, 2020

@eviltester It's not returning an array of elements, though. It just goes to the next line, shows an arrow pointing outwards, and says "undefined".

After experimenting a bit, since @TheMetalCode said it worked for him, I tried disabling GoodTwitter, and that seems to be it; your code is written to only work with the current version of Twitter, and incompatible with the older layout. Interesting, and good to know for future reference; might want to put a note that if someone is using GoodTwitter because they hate the new UI, they'll have to disable it to have it work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.