Skip to content

Instantly share code, notes, and snippets.

@ezy
Last active June 23, 2019 23:24
Show Gist options
  • Save ezy/e8f9db449186a205b7533b7e7e037fe9 to your computer and use it in GitHub Desktop.
Save ezy/e8f9db449186a205b7533b7e7e037fe9 to your computer and use it in GitHub Desktop.
Delete all twitter tweets, likes and retweets via the web inspector console
// These scripts allow you to scrub your twitter account clean by deleting unliking
// and unretweeting everything. Only works on the old twitter web interface. Currently
// you can enable this by going to your menu and selecting to use legacy mode.
// delete tweets
setInterval(
function() {
t = $( '.js-actionDelete button' ); // get delete buttons
for ( i = 0; true; i++ ) { // count removed
if ( i >= t.length ) { // if removed all currently available
window.scrollTo( 0, $( document ).height() ); // scroll to bottom of page - loads more
return
}
$( t[i] ).trigger( 'click' ); // click and remove button from dom
$( 'button.delete-action' ).trigger( 'click' ); // click and remove button from dom
}
}, 2000
)
// delete retweets
setInterval(
function() {
t = $( 'button.ProfileTweet-actionButtonUndo' ); // get delete buttons
for ( i = 0; true; i++ ) { // count removed
if ( i >= t.length ) { // if removed all currently available
window.scrollTo( 0, $( document ).height() ); // scroll to bottom of page - loads more
return
}
$( t[i] ).trigger( 'click' ); // click and remove button from dom
}
}, 2000
)
// unlike tweets
setInterval(
function() {
t = $( 'button.ProfileTweet-action--unfavorite' ); // get delete buttons
for ( i = 0; true; i++ ) { // count removed
if ( i >= t.length ) { // if removed all currently available
window.scrollTo( 0, $( document ).height() ); // scroll to bottom of page - loads more
return
}
$( t[i] ).trigger( 'click' ); // click and remove button from dom
}
}, 2000
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment