Skip to content

Instantly share code, notes, and snippets.

@no2pixel
Forked from jziggas/nowhal.js
Last active January 19, 2020 00:50
Show Gist options
  • Save no2pixel/8516494d68715e73f50d43a287558bde to your computer and use it in GitHub Desktop.
Save no2pixel/8516494d68715e73f50d43a287558bde to your computer and use it in GitHub Desktop.
JavaScript to delete all of your Reddit comments
// Go to https://www.reddit.com/user/<username>/ and paste into your console.
// Reddit throttles these actions, hence the 1s timer.
let interval = setInterval(() => {
let deleteButtons = $('a.togglebutton[data-event-action="delete"]');
if (deleteButtons.length === 0) {
clearInterval(interval);
if ($('.next-button > a')[0]) {
location.reload();
}
} else {
deleteButtons[0].click();
setTimeout(() => {
$('span.option.error.active > a.yes').click();
}, 300);
}
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment