Advertisement
rg443

fotomode.ru -> imgur

May 18th, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* 31465/28 */
  2. /* 31465/28 */
  3. /* cid:2 Glamour*/
  4. for (var i=0;i<=200;i++){
  5.    var r=new XMLHttpRequest();
  6.    r.i=i;
  7.    r.open("POST","http://fotomode.ru/ajax/new_photos_more/");
  8.    r.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
  9.    r.setRequestHeader("X-Requested-With","XMLHttpRequest");
  10.    r.responseType="text";
  11.    r.onreadystatechange=function(){
  12.       if (this.readyState==4 && this.status==200){
  13.          var s=this.responseText;
  14.          var a=(s.match(/[\w.]+(?=_crop200x200.jpg)/gim)||[]).map(function(v){return "http://fotomode.ru/photos/"+v+".jpg"});
  15.          (a.length>0)&&localStorage.setItem("il21-"+this.i,a.join(","));
  16.          (a.length>0)&&post_imgur(a,print1);
  17.          console.log(this.i,a.length);
  18.          //console.log(this.i,this.responseText.replace(/\s+/gm," "));
  19.          }
  20.       }
  21.    r.send("start="+(i*28)+"&cid=21");
  22.    }
  23.  
  24. function print1(){console.log(this.toString())}
  25. function post_imgur(a,callback) {        
  26. var r=new XMLHttpRequest();
  27. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  28. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  29. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  30. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  31. r.send("u=" + a.join(","));
  32. }
  33.  
  34. /* ----------------------------------------------------------------------------------------- */
  35. // http://fotomode.ru/contents/18
  36. var a=document.body.innerHTML.match(/[\w.]+(?=_crop200x200.jpg)/gim).map(function(v){return "http://fotomode.ru/photos/"+v+".jpg"});
  37. post_imgur(a,function(){console.log(a.length,this.toString().split("\n").length-1)});
  38.  
  39.  
  40.  
  41. function post_imgur(a,callback) {        
  42. var r=new XMLHttpRequest();
  43. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  44. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  45. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  46. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  47. r.send("u=" + a.join(","));
  48. }
  49.  
  50. /* fetch url */
  51. function get_url(url,callback) {
  52.         var r=new XMLHttpRequest();
  53.         r.open("GET",url,true);
  54.         r.onreadystatechange=function(){
  55.        if (this.readyState==4 && this.status==200) callback.call(this.responseText);
  56.        if (this.readyState==4) console.log(url);
  57.        }
  58.     r.send();      
  59.  
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement