Advertisement
rg443

listofimages grid (paging)

Jun 11th, 2013
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var pageSize = 20;
  2. var ig="//rg443.hj.cx/p/?url="
  3. var j = 1;
  4. if(!cache1) {
  5.   var cache1 = {}
  6. }
  7. if(!data1) {
  8.   var data1 = document.createElement("div");
  9.   document.body.insertAdjacentElement("afterBegin", data1)
  10. }
  11. data1.innerHTML = "";
  12. data1.style.marginLeft = "140px";
  13. data1.style.cursor = "pointer";
  14. data1.style.width = "1300px";
  15. data1.style.minHeight = "12250px";
  16. data1.style.overflowY = "visible";
  17. if(!next1) {
  18.   var next1 = document.createElement("span");
  19.   next1.innerText = "more...";
  20.   var n = next1.style;
  21.   n.font = "16pt Arial";
  22.   n.color = "blue";
  23.   n.cursor = "pointer";
  24.   n.marginLeft = data1.style.marginLeft;
  25.   data1.insertAdjacentElement("AfterEnd", next1)
  26. }
  27. function parse1() {
  28.   var a = this.match(/http:\/\/www.listofimages.com\/wp-content\/uploads\/\S+.jpg/gim), b = a.map(function(v, i) {
  29.     return'<img src="' + v.replace(/-\d+x\d+/, "").replace("http://", "http://127.0.0." + (i % 10 + 1) + "/wp1/") + '?resize=320,200" style="width:320px;height:200px;margin:2px;"/>'
  30.   });
  31.   data1.insertAdjacentHTML("beforeEnd", b.join(""))
  32. }
  33. data1.onclick = function(e) {
  34.   var e = e.srcElement || e.target;
  35.   if(e.tagName != "IMG") {
  36.     return
  37.   }
  38.   var w = window.open("about:blank");
  39.   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>';
  40.   setTimeout(function() {
  41.     w.location = "http://eho.st/" + e.src.match(/http\S+.jpg/)[0].replace(/127.0.0.\d+\/wp1\/|i\d+.wp.com/, "")
  42.   }, 300)
  43. };
  44. next1.onclick = function() {
  45.   post_imgur(data1.innerHTML.replace(/127.0.0.\d+\/wp1\/|i\d+.wp.com\//gim, "").match(/http\S+\.jpg/gim) || [], function() {
  46.     window.hl = this.toString();
  47.     console.log("imgur: " + (window.hl.split("\n").length - 1))
  48.   });
  49.   window.scroll(0, 0);
  50.   data1.innerHTML = "";
  51.   for(var i = j, t = new Date;i < j + pageSize;i++) {
  52.     setTimeout(get_url, (i - j - 1) * 200, ig+"http://www.listofimages.com/page/" + i, parse1)
  53.   }
  54.   document.title = "listofimages - " + j;
  55.   j += pageSize
  56. };
  57. document.onkeyup = function(e) {
  58.   if(e.keyCode == 34 && document.height - window.pageYOffset - window.innerHeight == 0) {
  59.     next1.onclick();
  60.     console.log("more")
  61.   }
  62. };
  63.  
  64. next1.click();
  65. function get_url(url, callback) {
  66.   if(cache1.hasOwnProperty(url) && callback) {
  67.     callback.call(cache1[url]);
  68.     return
  69.   }
  70.   var r = new XMLHttpRequest;
  71.   r.open("GET", url, true);
  72.   r.onreadystatechange = function() {
  73.     if(this.readyState == 4 && this.status == 200) {
  74.       callback.call(this.responseText);
  75.       cache1[url] = this.responseText
  76.     }
  77.   };
  78.   r.send()
  79. }
  80. function post_imgur(a, callback) {
  81.   var r = new XMLHttpRequest;
  82.   r.open("POST", "http://176.34.162.148/jabry/imgur1.asp?u=&b=", true);
  83.   r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  84.   r.onreadystatechange = function() {
  85.     if(this.readyState == 4 && this.status == 200) {
  86.       callback.call(this.responseText)
  87.     }
  88.   };
  89.   r.send("u=" + a.join(","))
  90. }
  91. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement