Advertisement
rg443

500px following post recursive to imgur

Jan 15th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* fetch url */
  2. function get_url(url,callback) {
  3.         var r=new XMLHttpRequest();
  4.         r.open("GET",url,true);
  5.         r.onreadystatechange=function(){
  6.        if (this.readyState==4 && this.status==200) callback.call(this.responseText);
  7.        }
  8.     r.send();      
  9.  
  10. }
  11. Array.prototype.unique = function(){
  12. return this.filter(function(s, i, a){ return i == a.lastIndexOf(s); });
  13. }
  14. function post_imgur(a,callback) {        
  15. var r=new XMLHttpRequest();
  16. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  17. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  18. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  19. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  20. r.send("u=" + a.join(","));
  21. }
  22. function post1(s) {
  23.    s=s.toString().replace(/3.jpg/gim,"4.jpg");
  24.    post_imgur(s.match(/^http.*jpg$/gim),function(){console.log(this.toString(),page)});
  25.    page--;
  26.    if (page) get_url("http://users1.jabry.com/rg443/f5i.asp?q=following&p="+page,function(){post1(this.toString())});
  27. }
  28. var page=324;
  29. get_url("http://users1.jabry.com/rg443/f5i.asp?q=following&p="+page,function(){post1(this.toString())});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement