Advertisement
rg443

nature forum (paging)

Jul 29th, 2013
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var page=1,pageSize=448;
  2. next1();
  3. document.onkeypress=function(e){if (e.keyCode==106){page++;next1()};if (e.keyCode==107){page--;next1()}};
  4.  
  5. function next1(){
  6. var r=new XMLHttpRequest();
  7. r.open("GET","https://naturfotografen-forum.de/ajax.php?action=indexscroll_do&limit="+pageSize+"&skip="+ (page-1)*pageSize,true);
  8. r.onload=function(){
  9.    var a=this.response.match(/o\d+-.*?(?=')/gim);
  10.    var s=a.map(function(v,i){var b=v.match(/o(\d+)-(.*)/);b[2]=decodeURIComponent(b[2]); return '<a href="https://naturfotografen-forum.de/'+v+'" target="_blank" title="'+b[2]+'"><img src="http://i' +(i%3)+ '.wp.com/naturfotografen-forum.de/data/o/'+Math.floor(b[1]/5000)+'/'+b[1]+'/image.jpg?resize=320,200" alt="'+b[2]+'" style="width:320px;height:200px;margin:2px;border-radius:7px;" /></a>'});
  11.    window.scroll(0,0);window.stop&&window.stop();
  12.    document.body.innerHTML=s.join("")+ '<br><span onclick="page++;next1();" style="font: 16pt Helvetica;color:blue;text-decoration:underline;cursor:pointer;">more</a>';
  13.    document.title= "nature photography - "+page;
  14.  
  15. }
  16. r.send();
  17. }
  18.  
  19.  
  20. function upload1(){
  21. for(var page = 1, pageSize = 500;page <= 140;page++) {
  22.   var r = new XMLHttpRequest;
  23.   r.open("GET", "http://naturfotografen-forum.de/ajax.php?action=indexscroll_do&limit=" + pageSize + "&skip=" + (page - 1) * pageSize, true);
  24.   r.onload = function() {
  25.     var a = this.response.match(/o\d+-.*?(?=')/gim);
  26.     var s = a.map(function(v) {
  27.       var b = v.match(/o(\d+)-(.*)/);
  28.       return"http://naturfotografen-forum.de/data/o/" + Math.floor(b[1] / 5E3) + "/" + b[1] + "/image.jpg"
  29.     });
  30.     console.log(s);
  31.     post_imgur(s, function() {
  32.       console.log("done")
  33.     })
  34.   };
  35.   r.send()
  36. }
  37. function post_imgur(a, callback) {
  38.   var r = new XMLHttpRequest;
  39.   r.open("POST", "http://176.34.162.148/jabry/imgur1.asp?u=&b=&x=", true);
  40.   r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  41.   r.onreadystatechange = function() {
  42.     if(this.readyState == 4 && this.status == 200) {
  43.       callback.call(this.responseText)
  44.     }
  45.   };
  46.   r.send("u=" + a.join(","))
  47. }
  48.  
  49. }
  50.  
  51. /*
  52. page 143
  53. 55/276833 last
  54.    276819 old
  55.  
  56.  
  57. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement