Advertisement
rg443

thefabweb, post images to imgur

Jan 22nd, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // 01/22/2013 - scape images from thefabweb
  2. var stack=0,il=[];
  3. for (var i=1;i<=168;i++){
  4. var r=new XMLHttpRequest();
  5. r.open("GET","http://thefabweb.com/page/"+i+"/");
  6. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200){
  7.    var u=this.responseText.match(/http:\/\/thefabweb.com\/\d+\//gim);
  8.    u.unique().forEach(function(v){
  9.       get_url(v,function(){
  10.          var a=this.toString().match(/http[^\s]*?\.jpg/gim);
  11.          //a && console.log(a.length + " images.");
  12.          a && il+=a;
  13.          if (a ) post_imgur(a,function(){
  14.              console.log(this.toString(),--stack);
  15.              })
  16.          })
  17.       });
  18.    }}
  19. r.i=i;
  20. r.send();
  21. }
  22.  
  23.  
  24. Array.prototype.unique = function(){return this.filter(function(s, i, a){ return i == a.lastIndexOf(s); });}
  25.  
  26. /* fetch url */
  27. function get_url(url,callback) {
  28.         var r=new XMLHttpRequest();
  29.         r.open("GET",url,true);
  30.         //r.setRequestHeader("X-Requested-With", "XMLHttpRequest");
  31.         //r.setRequestHeader("Accept-Encoding", "gzip");
  32.         r.onreadystatechange=function(){
  33.        if (this.readyState==4 && this.status==200 && callback) callback.call(this.responseText);
  34.        }
  35.     r.send();      
  36.  
  37. }
  38.  
  39. function post_imgur(a,callback) {        
  40. var r=new XMLHttpRequest();
  41. r.posted=a.length;
  42. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  43. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  44. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  45. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200 && callback) callback.call(this.responseText); }
  46. r.send("u=" + a.join(","));
  47. stack++;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement