Skip to content

Instantly share code, notes, and snippets.

@levelsio
Created January 3, 2019 08:07
Show Gist options
  • Save levelsio/3e12faacfc0ae151334aa1b3fcca0766 to your computer and use it in GitHub Desktop.
Save levelsio/3e12faacfc0ae151334aa1b3fcca0766 to your computer and use it in GitHub Desktop.
Twitter Inbox Cleaner (by @levelsio)
//
// Twitter lets you close your inbox to people you don't follow. The problem
// is that still authorizes ANYONE who sent you a message EVER to continue
// messaging you, even if your privacy settings are changed.
//
// The only way (I think) to avoid that is to delete every message from a
// person so that Twitter's internal check "did you talk to this person
// before?" results in FALSE. That sucks because maybe you want more privacy
// than before. But it's do-able by deleteing all the message history of each
// conversation.
//
// Since @timwhitlock's Twitter DM Cleaner went offline due to Twitter's
// changed API, I wanted to find a way how to empty my inbox without having
// to literally single-click every message
//
// USE AT YOUR OWN RISK THIS WILL DELETE ALL YOUR TWITTER INBOX MESSAGES
// YOU CAN NOT RECOVER THEM, MAKE SURE TO BACKUP BEFORE, YOUR TWITTER
// EXPORT DOES *NOT* BACKUP YOUR INBOX THOUGH!
//
// INSTRUCTIONS
// 1) Open your messages
// 2) Paste below in your console
// 3) It will open the first message/person
// 4) Start clearing messages from top
// 5) When done, it goes back to inbox
// 6) And it selects the next user's messages
// 7) To kill it, close your tab
//
$('.DMInboxItem').eq($('.DMInboxItem').length-1).click();
setInterval(function() {
$('.Icon--delete').eq(0).parent().parent().parent().parent().find('.tweet-text').text();
$('.Icon--delete').eq(0).click();
$('.DMDeleteMessage-confirm').click();
if($('.DirectMessage-text').length<2) {
$('.DMInboxItem').eq($('.DMInboxItem').length-1).click();
}
},100);
@pgm1212
Copy link

pgm1212 commented Jan 16, 2020

Uncaught TypeError: Cannot read property 'eq' of null
at :2:18
(anonymous) @ VM118:2
Help please

@Mosensei
Copy link

Got this error Uncaught TypeError: Cannot read property 'eq' of null
at :1:18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment