Advertisement
rg443

fotoblur.com - post images to imgur

Jan 10th, 2013
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* upload imgur */
  2. function post_imgur(a,callback) {    
  3. var r=new XMLHttpRequest();
  4. r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
  5. //r.open("POST","http://notebook1.lan:8000/jabry/imgur1.asp?u=&b=",true);
  6. r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  7. r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
  8. r.send("u=" + a.join(","));
  9. }
  10.  
  11. /* fetch url */
  12. function get_url(url,callback) {
  13.     var r=new XMLHttpRequest();
  14.     r.open("GET",url,true);
  15.     r.onreadystatechange=function(){
  16.        if (this.readyState==4 && this.status==200) callback.call(this.responseText);
  17.        }
  18.     r.send();      
  19.  
  20. }
  21. Array.prototype.unique = function(){
  22. return this.filter(function(s, i, a){ return i == a.lastIndexOf(s); });
  23. }
  24.  
  25. // fotoblur.com
  26. function fotoblur(tag,pages) {
  27. for (var stack=0,i=pages;i;i--,stack1++) get_url("http://www.fotoblur.com/gallery?filter="+tag+"&page="+i,function(v){
  28.    var a=this.match(/\/imgs\/.*?\/sm_\d+.jpg/gim).join("\n").replace(/\/sm_/gim,"/").replace(/^(.*)$/gim,"http://www.fotoblur.com$1").split("\n");
  29.    stack++;
  30.    post_imgur(a,function(v) {console.log(this.toString(),--stack,--stack1,this.toString().split("\n").length)});
  31.    });}
  32.  
  33. function fotoblur2(tag,pages) {
  34. for (var stack=0,i=pages;i;i--,stack1++) get_url("http://www.fotoblur.com/categories/"+tag+"?filter=views&page="+i,function(v){
  35.    var a=this.match(/\/imgs\/.*?\/sm_\d+.jpg/gim).join("\n").replace(/\/sm_/gim,"/").replace(/^(.*)$/gim,"http://www.fotoblur.com$1").split("\n");
  36.    stack++;
  37.    post_imgur(a,function(v) {console.log(this.toString(),--stack,--stack1,this.toString().split("\n").length)});
  38.    });}
  39.  
  40. var stack1=0;
  41. // fotoblur("votes",500);
  42. // fotoblur("views",500);
  43. // fotoblur("published",33);
  44. // fotoblur("features",101);
  45. // fotoblur("date",500);
  46. // fotoblur("favorites",5);
  47. // fotoblur("rising",5);
  48.  
  49. //fotoblur2("landscape-photography",10);
  50.  
  51. "Landscape,Portrait,Conceptual,People,Fine-Art,Street,Abstract,Architecture,Nature,Flower,General,Waterscape,Animal,Children,Cityscape,Macro,Digital-Manipulation,Urban,Outdoor,Artistic-Nude,Still-Life,Fashion,Travel,Bird,Night,Photojournalism,Glamour,Action,Interior,Insect,Concert,Event,Industrial,Plant,Sport,Humor,Automotive,Pet,Wedding,Digital-Darkroom,Vintage,Family,Food,Texture,Pattern,Studio,Advertising,Toy-Camera,Mature,Rural".split(",").forEach(function(v){fotoblur2(v+"-Photography",10);});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement