Skip to content

Instantly share code, notes, and snippets.

@techsin
Created May 27, 2015 02:49
Show Gist options
  • Save techsin/89917a2a19e51d3bd8e0 to your computer and use it in GitHub Desktop.
Save techsin/89917a2a19e51d3bd8e0 to your computer and use it in GitHub Desktop.
remove
(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})();
@Pppp4guu
Copy link

Bue

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