Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var r=new XMLHttpRequest();
- r.open("GET","picsarus-ps.txt")
- r.onreadystatechange=function(){
- if (this.readyState!=4) return;
- if (this.status!=200) {console.log(this.status,this.statusText);return -1}
- var s=this.responseText;
- var a=[],h={};
- s.match(/(\w+) (\S+)/g).forEach(function(v){
- var x=v.match(/(\w+) (.*)/);
- if(!h.hasOwnProperty(x[2])){
- a.push(x[1]);
- h[x[2]]=x[1];
- }
- });
- window.il=a.join(" ");
- window.page1=~~(a.length/1000)+1;
- var b=il.match(/\w+/g).map(function(v,i){return '<img src="http://127.0.0.1/wp1/www.picsarus.com/'+v+'.jpg?resize=280,280" alt="" width="280" height="280"/>' });
- document.body.insertAdjacentHTML("beforeEnd","<div id=\"data1\">"+ b.slice(0,1000).join("") +"</div>");
- }
- r.send();
- function show_page(page) {
- var d=document.getElementById("data1"); if(!d) {d=document.createElement("div");d.id="data1"; document.body.insertAdjacentElement("beforeEnd",d);}
- var pageSize=1000;
- if (!il) return -1;
- var b=il.match(/\w+/g).map(function(v,i){return '<img src="http://127.0.0.'+ ((i%10)+1)+'/wp1/www.picsarus.com/'+v+'.jpg?resize=280,280" alt="" width="280" height="280"/>' });
- d.innerHTML= b.slice((page-1)*pageSize,page*pageSize).join("");
- }
- var nav1=document.createElement("A");nav1.href="#";nav1.innerText=" Next "; nav1.onclick=function(){if(!page1||page1<1)page1=52; window.stop&&window.stop();show_page(page1--);this.title=page1;return false;};document.body.insertAdjacentElement("afterBegin",nav1);
- // show_page(page1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement