Created
December 8, 2016 02:26
-
-
Save crowbarsolutions/d5ae9997bb86168515a5764ee587275b to your computer and use it in GitHub Desktop.
Deletes all reddit comments/posts/whatever on your user page
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
(function deleteComments() { | |
var deleteButtons = document.querySelectorAll('[data-event-action="delete"]'); | |
[].forEach.call(deleteButtons, function(element) { | |
element.click(); | |
}); | |
var trigger = setInterval(function(){ | |
var yesButton = document.querySelector('.yes'); | |
if (yesButton === null) { | |
clearInterval(trigger); | |
var nextButton = document.querySelector('span.next-button > a'); | |
if(nextButton !== null) { | |
nextButton.click(); | |
deleteComments(); | |
} | |
} else { | |
yesButton.click(); | |
} | |
}, 750); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment