Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var tmr1=setInterval(function(){
- var pos1=document.height-window.pageYOffset-window.innerHeight;
- if (!loadState && pos1<=2000) {
- console.log("fire");
- get_url(location.pathname+"?q="+tag + "&p=" + page2,function(){
- loadState=false;
- console.log(tag,page2);
- var data2=this.toString().match(/<div id="data1" >(.*?)<\/div>/im);
- data2&&data1.insertAdjacentHTML("beforeEnd",data2[1]);
- });
- loadState=1;
- page2++;
- setTimeout(get_url,1000,location.pathname+"?q="+tag + "&p=" + page2); // prefetch next page
- }
- },300);var loadState=false,page2=page||2;
- 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.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(","));
- }
- // post_imgur(data1.innerHTML.match(/\d+\.jpg/gim).map(function(v){return "http://imghost.1x.com/"+v}),function(){console.log("imgur:",this.toString().split("\n").length-1)});
- // post_imgur(data1.innerHTML.match(/\d+\/\w+/gim).map(function(v){return "http://pcdn.500px.net/"+v+"/4.jpg"}),function(){console.log("imgur:",this.toString().split("\n").length-1)});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement