Advertisement
rg443

femaleform grid (paging)

Jun 12th, 2013
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var pageSize=25,pages=527;
  2. if (!data1) {var data1=document.createElement("div");document.body.insertAdjacentElement("afterBegin",data1)}; data1.innerHTML="";data1.style.marginLeft="140px";data1.style.cursor="pointer"; data1.style.width="1300px"; data1.style.minHeight="10000";data1.style.overflowY="visible";
  3. if (!next1) {var next1=document.createElement("span");next1.innerText="more..."; var n=next1.style; n.font="16pt Arial";n.color="blue";n.cursor="pointer";n.marginLeft=data1.style.marginLeft; data1.insertAdjacentElement("AfterEnd",next1);}
  4.  
  5. function parse1(){
  6.    var a=this.match(/http:\/\/femaleform.files.wordpress.com\/\S+\.jpg(?=["])/gim);a.splice(0,1);var b=a.map(function(v,i){return '<img src="'+v+'?w=240&h=320&crop=1" style="width:240px;margin:2px;"/>'});
  7.    data1.insertAdjacentHTML("beforeEnd",b.join(""));
  8.   }
  9.  
  10. data1.onclick=function(e){
  11.    var e=e.srcElement||e.target;
  12.    if (e.tagName!="IMG") return;
  13.    var w=window.open("about:blank");
  14.    w.location.href=e.src.match(/http.*?jpg/);
  15.    //w.document.body.innerHTML="<p style=\"font:menu\">loading image ...</p>";
  16.    //w.document.body.innerHTML='<div style="box-shadow: 10px 10px 5px dimgray;border-radius:10px;image-rendering: optimizeQuality;position:absolute;left:10%;top:10%;width:80%;height:80%;background-repeat:no-repeat;background-position:left top;background-size: cover;background-image:url('+e.src+')"></div>';
  17.    //setTimeout(function(){w.location="http://eho.st/"+e.src.match(/http\S+.jpg/)[0].replace(/127.0.0.\d+\/wp1\/|i\d+.wp.com/,"")},300);
  18.    }
  19.  
  20. var j=1;
  21. next1.onclick=function(){
  22.    post_imgur((data1.innerHTML.replace(/127.0.0.\d+\/wp1|i\d+.wp.com/gim,"").match(/http\S+\.jpg/gim))||[],function(){window.hl=this.toString();console.log("imgur:", (hl.split("\n").length-1))});
  23.    window.scroll(0,0); // data1.offsetTop
  24.    data1.innerHTML="";
  25.    for (var i=j;i<j+pageSize;i++) setTimeout(get_url,(i-j-1)*200,"http://users1.jabry.com/rg443/text.asp?url=http://femaleform.wordpress.com/page/"+i+"/",parse1);
  26.    document.title="femaleform - " +j;
  27.    j+=pageSize;
  28.    }
  29.  
  30. document.onkeyup=function(e){
  31.    //console.log(e.which , e.keyCode,document.height,window.pageYOffset,window.innerHeight)
  32.    // eof && pgdn
  33.    if (e.keyCode==34 && (document.height-window.pageYOffset-window.innerHeight)==0){next1.onclick();console.log("more");}
  34.    }
  35.  
  36.  
  37. next1.click();
  38.  
  39. function get_url(url,callback) {
  40.     var r=new XMLHttpRequest();
  41.     r.open("GET",url,true);
  42.     r.onreadystatechange=function(){
  43.        if (this.readyState==4 && this.status==200) callback.call(this.responseText);
  44.        }
  45.     r.send();      
  46.  
  47. }
  48. /* upload imgur */
  49. function post_imgur(a,callback) {    
  50. var r=new XMLHttpRequest();
  51. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  52. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  53. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  54. r.send("u=" + a.join(","));
  55. }
  56.  
  57. /* data1.innerHTML.match(/http\S+\.jpg/gim).join("\n"); */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement