Advertisement
rg443

*** nastol.com -> imgur

Mar 17th, 2013
150
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<=3615;i++)
  3. stack++&&get_url("http://www.nastol.com.ua/page/"+i+"/", function() {
  4.    
  5.    var a=this.match(/\d+\/\d+\.jpg/gim).join("\n").replace(/(\d+)\/(\d+)/gim,"http://www.nastol.com.ua/images/$1/nastol.com.ua_$2").split("\n");
  6.  
  7.    // console.log(a.join("\n"));
  8.    post_imgur(a,function(){
  9.       console.log("imgur: "+ (this.split("\n").length-1) ,--stack);
  10.       window.hl=this.toString();
  11.       //console.log(this.toString());
  12.    });
  13. });
  14.  
  15.  
  16. /* upload imgur */
  17. function post_imgur(a,callback) {    
  18. var r=new XMLHttpRequest();
  19. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  20. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  21. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  22. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  23. r.send("u=" + a.join(","));
  24. }
  25.  
  26. /* fetch url */
  27. function get_url(url,callback) {
  28.     var r=new XMLHttpRequest();
  29.     r.open("GET",url,true);
  30.     r.onreadystatechange=function(){
  31.        if (this.readyState==4 && this.status==200) callback.call(this.responseText);
  32.        }
  33.     r.send();      
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement