Advertisement
rg443

wallpaperswiki.org -> imgur

May 12th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var stack=0;
  2. for (var i=1;i<=637;i++){stack++;setTimeout(get_url,i*100,"http://wallpaperswiki.org/page/"+i, callback1);}
  3.  
  4.  
  5. function callback1() {
  6.   var a = this.toString().match(/http:\/\/wallpaperswiki.org\/wp-content\/uploads\/\S*?\.jpe*g/gim).map(function(v){return v  });
  7.  
  8.   console.log(a.join("\n"));
  9.  
  10.   post_imgur(a, function() {
  11.     console.log("imgur: " + (this.split("\n").length - 1), --stack);
  12.     window.hl = this.toString()
  13.   })
  14. }
  15. ;
  16.  
  17.  
  18. /* upload imgur */
  19. function post_imgur(a,callback) {    
  20. var r=new XMLHttpRequest();
  21. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  22. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  23. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  24. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  25. r.send("u=" + a.join(","));
  26. }
  27.  
  28. /* fetch url */
  29. function get_url(url,callback) {
  30.     var r=new XMLHttpRequest();
  31.     r.open("GET",url,true);
  32.     r.onreadystatechange=function(){
  33.        if (this.readyState==4 && this.status==200) callback.call(this.responseText);
  34.        }
  35.     r.send();      
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement