Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var cache1=cache1||{};
- // tumblr1("mindmayhem",304,"llnwd");
- function tumblr1(){
- var site=arguments[0]||"mindmayhem";
- var pages=arguments[1]||304;
- var filter=arguments[2];
- // console.log(site,pages,filter);
- for (var i=1;i<=pages;i++)setTimeout(get_url,(i-1)*100,"http://"+site+".tumblr.com/page/"+i,parse1);
- function parse1(){
- var a=this.match(/http:\/\/\S+.jpg/gim)||[];
- // new RegExp("\\w+")
- if (filter) a=a.filter(function(v){return new RegExp(filter).test(v)==false});
- // a=a.map(function(v){return v.replace("24.","25.")})
- a&&console.log(a.join("\n"));
- a&&post_imgur(a,print1);
- }
- function print1(){
- console.log("imgur:",this.split("\n").length-1);
- }
- }
- function get_url(url,callback) {
- if (cache1.hasOwnProperty(url) && callback) {callback.call(cache1[url]);return};
- var r=new XMLHttpRequest();
- r.open("GET",url,true);
- r.onreadystatechange=function(){
- if (this.readyState==4 && this.status==200) {cache1[url]=this.responseText;callback&&callback.call(this.responseText);};
- }
- r.send();
- }
- /* upload imgur */
- function post_imgur(a,callback) {
- var r=new XMLHttpRequest();
- r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
- r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- r.onreadystatechange=function(){if (this.readyState==4 && this.status==200) callback.call(this.responseText); }
- r.send("u=" + a.join(","));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement