Advertisement
rg443

naturfotografen-forum.de

Jan 6th, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* upload imgur */
  2. function post_imgur(a,callback) {    
  3. var r=new XMLHttpRequest();
  4. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  5. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  6. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  7. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  8. r.send("u=" + a.join(","));
  9. }
  10.  
  11. /* fetch url */
  12. function get_url(url,callback) {
  13.     var r=new XMLHttpRequest();
  14.     r.open("GET",url,true);
  15.     r.onreadystatechange=function(){
  16.        if (this.readyState==4 && this.status==200) callback.call(this.responseText);
  17.        }
  18.     r.send();      
  19.  
  20. }
  21. Array.prototype.unique = function(){
  22. return this.filter(function(s, i, a){ return i == a.lastIndexOf(s); });
  23. }
  24. function folder1(val) {
  25. var r=160;
  26. val=parseInt(val);
  27. if (800000 <val) r=160;
  28. else if (795000 < val) r=159;
  29. else r=158;
  30. return r;
  31. }
  32. function folder2(val) {
  33.  var i=160,j=800000;
  34.  for (i=i;i;i--,j-=5000) {
  35.  if (j<val) break;
  36.  }
  37. return i;
  38.  
  39. }
  40.  
  41. var stack=0;for (var i=0;i<10;i++) get_url("http://naturfotografen-forum.de/ajax.php?action=indexscroll_do&limit=100&skip="+ (i*100),function(){
  42. var x=(this.match(/data-object_id='\d+'/gim)||[]).unique();
  43. x=x.join("\n").match(/\d+/gim);
  44. x.forEach(function(v,i,a){a[i]="http://naturfotografen-forum.de/data/o/" + folder2(v)+ "/" +v + "/image.jpg"});
  45. console.log(x.join("\n"));
  46. console.log(--stack,this.length,x.length)
  47.  
  48. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement