Advertisement
rg443

wallpowper.com -> imgur

May 9th, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // http://www.wallpowper.com/wallpaper/2013/04/30/
  2. var b=document.body.innerHTML.match(/<a href="(\S+\.jpg)">/gim).map(function(v){return v.match(/<a href="(\S+\.jpg)">/i)[1] });a;
  3. var a=b.map(function(v){return location.origin+location.pathname+v});
  4. post_imgur(a,print1);
  5.  
  6. function print1(){console.log("imgur",a.length,this.toString().split("\n").length-1)};
  7. /* upload imgur */
  8. function post_imgur(a,callback) {    
  9. var r=new XMLHttpRequest();
  10. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  11. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  12. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  13. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  14. r.send("u=" + a.join(","));
  15. }
  16.  
  17. /* fetch url */
  18. function get_url(url,callback) {
  19.     var r=new XMLHttpRequest();
  20.     r.open("GET",url,true);
  21.     r.onreadystatechange=function(){
  22.        if (this.readyState==4 && this.status==200) callback.call(this.responseText);
  23.        }
  24.     r.send();      
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement