Last active
May 2, 2018 02:05
-
-
Save thelastfantasy/6394709687fc8ea4bb10b50abdfe4cec to your computer and use it in GitHub Desktop.
Delete all of your tweets
This file contains 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
// Go to your Twitter profile page: https://twitter.com/username | |
setInterval(deleteTweets, 2000); | |
function deleteTweets() { | |
jQuery('.js-stream-item:visible').each(function () { | |
var id = jQuery(this).data('item-id'); | |
var that = this; | |
jQuery.post( | |
'https://twitter.com/i/tweet/destroy', | |
{ | |
'_method': 'DELETE', | |
'authenticity_token': jQuery('.authenticity_token').val(), | |
'id': id | |
}, | |
function (data) { | |
$('.ProfileNav-item .ProfileNav-value[data-is-compact="true"]').text(data['profile_stats'][0]['highline_stat_value']); | |
$(that).remove(); | |
$("html, body").animate({ scrollTop: 0 }, 350); | |
if (jQuery('.js-stream-item:visible').length === 0) { | |
$("html, body").animate({ scrollTop: $(document).height() }, 0); | |
} | |
}, | |
'json' | |
); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment