rg443

wallpapervortex -> imgur

Feb 27th, 2013
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function get_url(url,callback) {
  2.         var r=new XMLHttpRequest();
  3.         r.open("GET",url,true);
  4.         //r.setRequestHeader("X-Requested-With", "XMLHttpRequest");
  5.         //r.setRequestHeader("Accept-Encoding", "gzip");
  6.         r.onreadystatechange=function(){
  7.        if (this.readyState==4 && this.status==200 && callback) callback.call(this.responseText);
  8.        }
  9.     r.send();      
  10.  
  11. }
  12.  
  13. function post_imgur(a,callback) {        
  14. var r=new XMLHttpRequest();
  15. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  16. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  17. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  18. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback&&callback.call(this.responseText); }
  19. r.send("u=" + a.join(","));
  20. }
  21.  
  22. function wp_vortex(tag,pages) {
  23.    var stack1=0;
  24.    for (var i=1;i<=pages;i++) stack1++&&get_url("http://www.wallpapervortex.com/"+tag+"-wallpapers-page"+i+".html?sort=views",function(){
  25.    var s=this.toString().match(/http\S+\.jpg/gim).join("\n").replace(/aa_/gim,"");
  26.    //console.log(s);
  27.    post_imgur(s.split("\n"),function(){console.log(this.toString(),--stack1)});
  28.    });
  29. }
  30. /*
  31. cars 54
  32. travel 11
  33. photography 75
  34. miscellaneous 148
  35. military 8
  36. celebrity 106
  37.  
  38.  
  39. */
  40. wp_vortex("cars",54);
  41. // wp_vortex("celebrity",106);
Advertisement
Add Comment
Please, Sign In to add comment