Created
May 27, 2015 02:49
-
-
Save techsin/89917a2a19e51d3bd8e0 to your computer and use it in GitHub Desktop.
remove
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(){function k(a,b){var c=a.data;c.children.forEach(function(a){b.push(a.data.name)});(c=c.after)?e(c):(console.log(b),confirm("Delete All?")&&l(m()))}function m(){var a=0;f=setInterval(function(){n(a++);!d.length>a&&clearInterval(f)},200)}function n(a){$.ajax({url:"http://www.reddit.com/api/unsave",type:"post",data:{id:d[a]},headers:{"X-Modhash":g},success:function(){console.log("delete",a);0==a%10&&console.log("Eats a potato chip")}})}function e(a){var b=h;a&&(console.log("got after",a), | |
b=h+"&after="+a);setTimeout(function(){$.getJSON(b).done(function(a){k(a,d)})},200)}function l(a){$.getJSON("http://www.reddit.com/api/me.json").done(function(b){g=b.data.modhash;a()})}var d=[],g=null,h="http://www.reddit.com/user/"+window.location.href.match(/user\/([^/]*)/)[1]+"/saved.json?limit=100";(function(){if(!jQuery){var a=void 0,a=document.createElement("script");a.type="text/javascript";a.src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";document.getElementsByTagName("head")[0].appendChild(a)}})(); | |
e();var f=null})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bue