Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var i1=3028;
- i1-=100;
- console.log(i1);
- 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(","));
- }
- 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();
- }
- var data1=document.getElementById("data1"); data1&&data1.parentNode.removeChild(data1);
- var data1=document.createElement("div");data1.id="data1";data1.style.height="auto";document.body.insertAdjacentElement("afterBegin",data1);
- var stack=0;
- var list1=[];
- for (var i=i1;i<i1+100;i++) get_url("http://www.zastavki.com/eng/"+i+"/",function(){
- var s=this.toString();
- var a1=s.match(/http:\/\/www.zastavki.com\/pictures\/\S+\.jpg/gim);
- var a2=s.match(/\d+x\d+(?=<\/div>)/gim);
- var a=a1.map(function(v,i){var s=a2[i];if (parseInt(s)>9999) s="originals"; return v.replace(/\d+x\d+/,s).replace("_32.jpg","_.jpg") });
- stack++;
- console.log(stack);
- //post_imgur(a,function(){console.log(--stack,a.length,this.toString().split("\n").length-1)});
- //console.log(a.join("\n"));
- list1=list1.concat(a);
- /* thumbnails */
- var s=a.map(function(v,i){return '<img src="http://127.0.0.1'+ (i%10) +'/wp1/'+v.replace("http://","")+'?resize=320,200" alt="..." style="margin:0px;width:320px;height:200px" />' });
- data1.insertAdjacentHTML("beforeEnd",s.join(" "));
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement