Advertisement
rg443

*** artleo.com -> imgur

Jan 1st, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* http://www.artleo.com/mostdownloads/page/35/ */
  2. //var x=["winter",87];
  3. // var x=["mostdownloads",303];
  4. var s="animals 516";
  5. /*
  6. mostdownloads 324
  7. girls 869
  8. beautiful 61
  9. natural 372
  10. macro 55   
  11. flowers 118
  12. food 167
  13. interior 61
  14. people 18
  15. aviation 28
  16. space 59
  17. newyear 43
  18. sport 37
  19. ships 14
  20. kids 36
  21. minimalize 47
  22. gun 43
  23. auto 207
  24. bikes 13
  25. towns 95
  26. animals 516
  27. spring 6
  28. summer 29
  29. autumn 31
  30. winter 87
  31. */
  32.  
  33. var stack=0,x=s.match(/^(\w+) (\d+)$/); var stack=0;
  34. for (var i=parseInt(x[2]);i;i--)
  35. stack++&&get_url("http://www.artleo.com/"+x[1]+"/page/"+i+"/", function() {
  36.    
  37.    var a=this.match(/\d+\/\d+\.jpg/gim).join("\n").replace(/(\d+)\/(\d+)/gim,"http://www.artleo.com/images/$1/artleo.com_$2").split("\n");
  38.    a && a.forEach(function(v,i,a) {a[i]=unescape(v).replace(/^(.*?url=)(.*)$/,"$2").replace(/http:\/\/i0.wp.com\//,"http://"); });
  39.    //console.log(a.join("\n"));
  40.    post_imgur(a,function(){
  41.       console.log("imgur: "+ this.split("\n").length,--stack);
  42.       window.hl=this.toString();
  43.       //console.log(this.toString());
  44.    });
  45. });
  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.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  53. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  54. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  55. r.send("u=" + a.join(","));
  56. }
  57.  
  58. /* fetch url */
  59. function get_url(url,callback) {
  60.     var r=new XMLHttpRequest();
  61.     r.open("GET",url,true);
  62.     r.onreadystatechange=function(){
  63.        if (this.readyState==4 && this.status==200) callback.call(this.responseText);
  64.        }
  65.     r.send();      
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement