Advertisement
rg443

500px gridview 280x280 [paging]

May 27th, 2013
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var tag = "photos",
  2.     ig = "";
  3. ig = "http://rg443.hj.cx/p/?url=";
  4. ig = "http://rg443.webs.pm/p/?url=";
  5. ig = "http://rg443.bugs3.com/p/?url=";
  6. ig = "http://rg443.3owl.com/p/?url=";
  7.  
  8. ig = "http://rg443.hj.cx/p/?url=|http://rg443.webs.pm/p/?url=|http://rg443.bugs3.com/p/?url=|http://rg443.3owl.com/p/?url=|http://rg443.juplo.com/p/?url=|http://rg443.binhoster.com/p/?url=|http://rg443.pixub.com/p/?url=|http://rg443.hints.me/p/?url=|http://photos1.servepics.com/jabry/proxy1.php?url=".split("|")[Math.floor(8 * Math.random())];
  9.  
  10. ig = "http://photos1.servepics.com/jabry/proxy1.php?url=";
  11. var url1 = "http://500px.com/" + tag + "?page=";
  12. for (var i = 1, t = new Date(); i <= 20; i++) setTimeout(get_url, i * 100, ig + url1 + i, parse1);
  13.  
  14.  
  15. if (!data1) {
  16.     var data1 = document.createElement("div");
  17.     document.body.insertAdjacentElement("afterBegin", data1);
  18.     }
  19. data1.innerHTML = "";
  20. data1.style.marginLeft = "140px";
  21. data1.style.cursor = "pointer";
  22. data1.style.width = "1136px";
  23. data1.style.minHeight = "28400px";
  24. if (!next1) {
  25.     var next1 = document.createElement("span");
  26.     next1.innerText = "more...";
  27.     var n = next1.style;
  28.     n.font = "16pt Arial";
  29.     n.color = "blue";
  30.     n.cursor = "pointer";
  31.     n.marginLeft = data1.style.marginLeft;
  32.     data1.insertAdjacentElement("AfterEnd", next1);
  33.     }
  34.  
  35. next1.insertAdjacentHTML("AfterEnd", "<div style=\"display:inline;cursor:pointer;font:11px Arial;margin-left:15px\"><span onclick=\"tag='photos',j=1;next1.click();\">popular</span> <span onclick=\"tag='upcoming',j=1;next1.click();\">upcoming </span> <span onclick=\"tag='editors',j=1;next1.click();\">editors </span> <span onclick=\"tag='rg443/favorites',j=1;next1.click();\">favorites </span></div>");
  36.  
  37. function parse1() {
  38.     var a = this.match(/\d+\/\w{40}(?=\/[^1])/gim) || [],
  39.         b = a.map(function (v) {
  40.             return '<img src="http://127.0.0.' + (v.match(/\d+/) % 10 + 1) + '/5x/' + v + '/3.jpg" style="width:280px;height:280px;margin:2px;"/>';
  41.         });
  42.     data1.insertAdjacentHTML("beforeEnd", b.join(""));
  43.     }
  44.  
  45. data1.onclick = function (e) {
  46.     e = e.srcElement || e.target;
  47.     if (e.tagName != "IMG") return;
  48.     var tag = e.src.match(/(\d+)\/(\w{40})/);
  49.     if (!tag) return false;
  50.     var w = window.open("about:blank");
  51.     w.location = "http://500px.com/photo/" + tag[1];
  52.     };
  53.  
  54.  
  55. var j = 20;
  56. next1.onclick = function () {
  57.     post1();
  58.     window.scroll(0, 0);
  59.     data1.innerHTML = "";
  60.     url1 = "http://500px.com/" + tag + "?page=";
  61.     t = new Date();
  62.     for (var i = j, k = 0; i < j + 20; i++, k += 200) setTimeout(get_url, k, ig + url1 + i, parse1);
  63.     this.title = j;
  64.     document.title = tag + " - " + j;
  65.     j += 20;
  66.     return false;
  67.     };
  68.  
  69. document.onkeyup = function (e) {
  70.     if (e.keyCode == 34 && (document.height - window.pageYOffset - window.innerHeight) === 0) {
  71.         next1.onclick();
  72.         console.log("more");
  73.         }
  74.     if (e.keyCode == 74) { // j
  75.         next1.onclick();
  76.         return false;
  77.         }
  78.     if (e.keyCode == 75) { // k
  79.         j -= 40;
  80.         j < 1 && (j = 1);
  81.         next1.onclick();
  82.         return false;
  83.         }
  84.  
  85.     };
  86.  
  87. console.log();
  88.  
  89. function get_url(url, callback) {
  90.     var r = new XMLHttpRequest();
  91.     r.t1 = new Date();
  92.     r.open("GET", url, true);
  93.     r.onload = function () {
  94.         callback.call(this.response);
  95.         if (this.readyState == 4) {
  96.             console.log(parseInt(unescape(url).match(/page=(\d+)/)[1]), (this.response.match(/\d+\/\w{40}(?=\/[^1])/gim) || []).length, new Date() - t, new Date() - this.t1);
  97.         }
  98.     };
  99.     r.send();
  100. }
  101.  
  102.  
  103. function post_imgur(a, callback) {
  104.     var r = new XMLHttpRequest();
  105.     r.open("POST", "http://176.34.162.148/jabry/imgur1.asp?u=&b=", true);
  106.     r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  107.     r.onreadystatechange = function () {
  108.         if (this.readyState == 4 && this.status == 200) callback && callback.call(this.responseText);
  109.     };
  110.     r.send("u=" + a.join(","));
  111. }
  112.  
  113. function post1() {
  114.     post_imgur((data1.innerHTML.match(/\d+\/\w{40}/gim) || []).map(function (v) {
  115.         return "http://pcdn.500px.net/" + v + "/5.jpg";
  116.         }), function () {
  117.             console.log("imgur:", this.toString().split("\n").length - 1);
  118.             window.hl = this.toString()
  119.         });
  120.     }
  121.  
  122.  
  123. /*
  124. var a=document.body.innerHTML.match(/\d+\/\w{40}(?=\/[^1])/gim),b=a.map(function(v){return '<img src="http://notebook1.lan/5x/'+v+'/3.jpg" style="width:auto; height:auto"/>'});document.body.insertAdjacentHTML("afterBegin",b.join("")); */
  125. /*
  126. http://500px.com/search?tag=Crested%20Caracara
  127. http://500px.com/search?q=Crested+Caracara&type=photos&page=1  photos_tags
  128. http://500px.com/search?utf8=%E2%9C%93&q=Canon+EOS-1D+X
  129. http://500px.com/fresh?page=2&period=today | yesterday | week || upcoming | popular | editors
  130. http://500px.com/rg443
  131. http://500px.com/rg443/favorites [jquery]
  132. http://500px.com/rg443/flow [jquery]
  133. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement