Skip to content

Instantly share code, notes, and snippets.

@thelastfantasy
Last active May 2, 2018 02:05
Show Gist options
  • Save thelastfantasy/6394709687fc8ea4bb10b50abdfe4cec to your computer and use it in GitHub Desktop.
Save thelastfantasy/6394709687fc8ea4bb10b50abdfe4cec to your computer and use it in GitHub Desktop.
Delete all of your tweets
// 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