Skip to content

Instantly share code, notes, and snippets.

@ispeakcomputer
Forked from jziggas/nowhal.js
Last active November 11, 2022 22:42
Show Gist options
  • Save ispeakcomputer/60c65d4faa69d53cc654ae923aeda4ad to your computer and use it in GitHub Desktop.
Save ispeakcomputer/60c65d4faa69d53cc654ae923aeda4ad 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.
// Make sure to goto your profile > user settings > opt out of redesign.
// If you do not run this against the old theme it will not work
let interval = setInterval(() => {
let deleteButtons = $('a.togglebutton[data-event-action="delete"]');
if (deleteButtons.length === 0) {
clearInterval(interval);
if ($('.next-button > a')[0]) {
$('.next-button > a')[0].click();
alert('Restart script.');
}
} else {
deleteButtons[0].click();
setTimeout(() => {
$('span.option.error.active > a.yes').click();
}, 300);
}
}, 1000);
@ispeakcomputer
Copy link
Author

Updated the snippet to get it working on the old theme

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