Advertisement
rg443

fgd.asp auto pager

Apr 8th, 2013
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. get_url("?q="+tag+"&p="+(page+1),print)
  2.  
  3.  
  4. function get_url(url,callback) {
  5.         var r=new XMLHttpRequest();
  6.         r.open("GET",url,true);
  7.         //r.setRequestHeader("X-Requested-With", "XMLHttpRequest");
  8.         //r.setRequestHeader("Accept-Encoding", "gzip");
  9.         r.onreadystatechange=function(){
  10.        if (this.readyState==4 && this.status==200 && callback) callback.call(this.responseText);
  11.        }
  12.     r.send();      
  13.  
  14. }
  15. function print(){
  16.    var s=this.toString();
  17.    var a=s.match(/<div.*?data1.*?>(.*?)<\/div>/)[1];
  18.    var data1=document.getElementById("data1");
  19.    data1.insertAdjacentHTML("beforeEnd",a);page++;
  20.    console.log(new Date(),page);
  21.    setTimeout(get_url,9000,"?q="+tag+"&p="+(page+1),print);
  22.    var il=data1.getElementsByTagName("img");
  23.    if (il.length>5000) {while(il.length>5000){il[0].parentNode.removeChild(il[0])}  }
  24.    setTimeout(function(){for (var il=document.images,i=0;i<il.length;i++) if(!il[i].complete) il[i].src=il[i].src.replace('notebook1.lan','127.0.0.1'+ (i%10))},1000);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement