Advertisement
rg443

favimages to imgur

Feb 10th, 2013
123
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. /*
  23. var a= document.body.innerHTML.match(/http:\S+\.jpg/gim).map(function(v){return v.replace(/-\d+x\d+/,"")});
  24. post_imgur(a);
  25. */
  26. // love funny inspirational famous life cute best motivational friendship birthday happiness positive brainy movie
  27. var tag="movie",i2=2;
  28.  
  29. for(var i=1,q=0;i<=693;i++,q++) get_url("http://favimages.net/page/"+i+"/",function(){
  30. // for(var i=1,q=0;i<=i2;i++,q++) get_url("http://favimages.net/tag/"+tag+"/page/"+i+"/",function(){
  31.    var a= document.body.innerHTML.match(/http:\S+\.jpg/gim).map(function(v){return v.replace(/-\d+x\d+/,"")});
  32.    a&&console.log(q--,a.length);
  33.    post_imgur(a);
  34.  
  35.  
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement