Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var page=1,page_size=20,tag="popular";
- var data1=document.createElement("div");document.body.innerHTML="";document.body.appendChild(data1);
- for (var i=(page-1)*page_size+1;i<=page*page_size;i++){
- var r=new XMLHttpRequest();r.open("GET","http://users1.jabry.com/rg443/f5i.asp?q="+tag+"&p="+i);
- r.i=i;
- r.onreadystatechange=function(){
- if (this.readyState!=4 || this.status!=200) return;
- var s=this.responseText.match(/(http.*.jpg)/gim).join("\n").replace(/(http:\/\/pcdn.500px.net\/)(.*.jpg)/gim,'<img src="http://127.0.0.'+ (~~(Math.random()*10)+1)+'/5x/$2" alt="500px" width="280" height="280"/>');
- setTimeout(function(){data1.insertAdjacentHTML("beforeEnd",s)},50);
- console.log(this.i,(""+this.responseText).split("\n").length);
- post_imgur(this.responseText.match(/(http.*.jpg)/gim).join("\n").replace(/\/3.jpg/gim,"/4.jpg").match(/(http.*.jpg)/gim),function(){console.log("imgur: " +this.toString().split("\n").length)});
- }
- r.send();
- }
- /* upload imgur */
- 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.call(this.responseText); }
- r.send("u=" + a.join(","));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement