Advertisement
rg443

good-wallpapers -> imgur

Mar 4th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // good-wallpapers
  2.  
  3. function post_imgur(a,callback) {        
  4. var r=new XMLHttpRequest();
  5. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  6. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  7. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  8. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback&&callback.call(this.responseText); }
  9. r.send("u=" + a.join(","));
  10. }
  11. function get_url(url,callback) {
  12.         var r=new XMLHttpRequest();
  13.         r.open("GET",url,true);
  14.         //r.setRequestHeader("X-Requested-With", "XMLHttpRequest");
  15.         //r.setRequestHeader("Accept-Encoding", "gzip");
  16.         r.onreadystatechange=function(){
  17.        if (this.readyState==4 && this.status==200 && callback) callback.call(this.responseText);
  18.        }
  19.     r.send();      
  20.  
  21. }
  22.  
  23. var stack=0;
  24. for (var i=1;i<=893;i++) get_url("http://good-wallpapers.com/rating/?page="+i,function(){
  25.    var a=this.toString().match(/\/\S+\.(jpe*g|png)/gim);
  26.    if (!a) a=[];
  27.    
  28.    a=a.map(function(v){return "http://good-wallpapers.com"+v.replace("small_","")});
  29.    stack++;
  30.    post_imgur(a,function(){console.log(--stack,a.length,this.toString().split("\n").length-1)});
  31.    //console.log(a.join("\n"));
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement