Created
February 1, 2015 22:46
-
-
Save aholmes/d286e977408554f97bc3 to your computer and use it in GitHub Desktop.
Delete old reddit posts
This file contains hidden or 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
| // Change this to the URL of your profile where you'd like to start deleting posts. | |
| var startUrl = 'http://www.reddit.com/user/YOUR_USER_NAME/?count=100&after=WHATEVER_THE_TAG_IS'; | |
| function reload(cb) | |
| { | |
| var newdoc=undefined; | |
| $.ajax(startUrl).success(function(data) | |
| { | |
| newdoc=$(data); | |
| cb(newdoc.find('.del-button .option .yes')); | |
| }); | |
| } | |
| function deletePosts(delLinks) | |
| { | |
| var rtimeout=undefined; | |
| delLinks.each(function(i,e) | |
| { | |
| (function(e) | |
| { | |
| window.setTimeout(function() | |
| { | |
| e.click(); | |
| }, 500 * i); | |
| })(e); | |
| if (rtimeout) { window.clearTimeout(rtimeout); } | |
| rtimeout = window.setTimeout(function() { reload(deletePosts); }, (500 * i) + 500); | |
| }); | |
| } | |
| reload(deletePosts); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment