Advertisement
rg443

pixoto.com --> imgur

Jul 27th, 2013
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // http://www.pixoto.com/images-photography/all/all/leading/in-week-30-2013?mature=true
  2. var a=document.body.innerHTML.match(/http:\/\/lh\d+.ggpht.com\/\S+(?==s270-c)/gim).map(function(v){return v.replace(/\/lh\d\./,"/lh3.")+"=s0"});
  3. post_imgur(a,function(){console.log("done.");});
  4.  
  5.  
  6. function post_imgur(a,callback) {        
  7. var r=new XMLHttpRequest();
  8. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=&x=",true);
  9. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  10. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  11. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  12. r.send("u=" + a.join(","));
  13. }
  14.  
  15. /* bulk upload */
  16. for (var i=0,j=0,k=0;i<10000;i++) setTimeout(function(i){
  17.    j++;
  18.    var r=new XMLHttpRequest();
  19.    r.open("GET","http://www.pixoto.com/images-photography/all/all/leading/in-all?json=true&offset="+(i*100)+"&limit=100&mature=true",true);
  20.    r.i=i;
  21.    r.onload=function(){
  22.       var a=[];
  23.       j--;
  24.       if (this.status!=200) {
  25.           console.log("failed:",this.i,this.status,this.readyState,this.getAllResponseHeaders());return;
  26.           }
  27.       var d=JSON.parse(this.response);
  28.       console.log("page:",this.i,j);
  29.       for (var i=0;i<d.list.length;i++) a.push(d.list[i].url.replace(/lh\d+.ggpht.com/,"lh3.ggpht.com")+"=s0");
  30.       k++;post_imgur(a,function(){console.log("imgur:",--k);});
  31.       }
  32.    r.send();
  33.  
  34. },i*500+j*500,i);
  35.  
  36.  
  37. function post_imgur(a,callback) {        
  38. var r=new XMLHttpRequest();
  39. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=&x=",true);
  40. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  41. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  42. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  43. r.send("u=" + a.join(","));
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement