Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 01/22/2013 - scape images from thefabweb
- var stack=0,il=[];
- for (var i=1;i<=168;i++){
- var r=new XMLHttpRequest();
- r.open("GET","http://thefabweb.com/page/"+i+"/");
- r.onreadystatechange=function(){if (this.readyState==4 && this.status==200){
- var u=this.responseText.match(/http:\/\/thefabweb.com\/\d+\//gim);
- u.unique().forEach(function(v){
- get_url(v,function(){
- var a=this.toString().match(/http[^\s]*?\.jpg/gim);
- //a && console.log(a.length + " images.");
- a && il+=a;
- if (a ) post_imgur(a,function(){
- console.log(this.toString(),--stack);
- })
- })
- });
- }}
- r.i=i;
- r.send();
- }
- Array.prototype.unique = function(){return this.filter(function(s, i, a){ return i == a.lastIndexOf(s); });}
- /* fetch url */
- function get_url(url,callback) {
- var r=new XMLHttpRequest();
- r.open("GET",url,true);
- //r.setRequestHeader("X-Requested-With", "XMLHttpRequest");
- //r.setRequestHeader("Accept-Encoding", "gzip");
- r.onreadystatechange=function(){
- if (this.readyState==4 && this.status==200 && callback) callback.call(this.responseText);
- }
- r.send();
- }
- function post_imgur(a,callback) {
- var r=new XMLHttpRequest();
- r.posted=a.length;
- r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
- //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
- r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- r.onreadystatechange=function(){if (this.readyState==4 && this.status==200 && callback) callback.call(this.responseText); }
- r.send("u=" + a.join(","));
- stack++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement