rg443

wallpaperzip.com -> imgur

Jul 6th, 2013
208
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<=459;i++){stack++;setTimeout(get_url,i*150,"http://www.wallpaperzip.com/wallpaper/page_"+i+".html", callback1);}
  3. /*
  4.    http://www.wallpaperzip.com         459
  5.    http://www.hot-girl-wallpaper.com   137
  6.    http://www.carwallpapers.ws         150
  7.    http://www.hdwallpapers.name         14
  8.    http://www.desktopbackgrounds.ws     16
  9.    http://www.naturewallpapers.ws       82
  10. */
  11.  
  12. function callback1() {
  13.   var a = this.toString().match(/http.*jpg(?=<\/DIV>)/gim).map(function(v){return v  });
  14.  
  15.   console.log(a.join("\n"));
  16.  
  17.   post_imgur(a, function() {
  18.     console.log("imgur: " + (this.split("\n").length - 1), --stack);
  19.     window.hl = this.toString()
  20.   })
  21. }
  22. ;
  23.  
  24.  
  25. /* upload imgur */
  26. function post_imgur(a,callback) {    
  27. var r=new XMLHttpRequest();
  28. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  29. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  30. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  31. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  32. r.send("u=" + a.join(","));
  33. }
  34.  
  35. /* fetch url */
  36. function get_url(url,callback) {
  37.     var r=new XMLHttpRequest();
  38.     r.open("GET",url,true);
  39.     r.onreadystatechange=function(){
  40.        if (this.readyState==4 && this.status==200) callback.call(this.responseText);
  41.        }
  42.     r.send();      
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment