Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Dec 23rd, 2012  |  syntax: JavaScript  |  size: 1.28 KB  |  hits: 284  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. imgurcache=new Array;var Imgur={fetch:function(e){var t=this;t.total=e;t.done=0;t.failures=0;t.start=+(new Date);$("#images").empty();for(var n=0;n<e;n++){t.hunt(function(e){t.done++;$("#images").append("<a href='http://i.imgur.com/"+e+".jpg' target='_blank' rel='noreferrer'><img src='http://i.imgur.com/"+e+"s.png' height='110' width='110' /></a>");t.update()})}},update:function(){function t(t){return~~(t/e*1e5)/100}var e=new Date-this.start;$("#info").html((this.done<this.total?"Loading.. "+this.done+"/"+this.total+" ("+this.failures+" failures"+") ":"Done. ")+"["+t(this.failures+this.done)+" req/s - "+t(this.done)+" img/s]")},hunt:function(e){function i(){t.failures++;t.update();t.hunt(e)}var t=this,n=t.random(5),r=new Image;t.update();r.src="http://i.imgur.com/"+n+"s.png";r.onload=function(){if(r.width==198&&r.height==160||r.width==161&&r.height==81){i()}else{e(n)}};r.onerror=i},random:function(e){var t=new Array;var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var r=0;r<e;r++){imgurchar=n.charAt(Math.floor(Math.random()*n.length));if(t.indexOf(imgurchar)==-1){t.push(imgurchar)}else{r--}}t=t.join("");if(imgurcache.indexOf(t)==-1){imgurcache.push(t);return t}else{self.random(5);return false}}};$("#random").unbind().bind("click",function(e){Imgur.fetch(500)})