Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var stack=0,list1=[];
- for (var i=1;i<=246;i++){stack++;setTimeout(get_url,i*100,"http://www.mrwallpaper.com/page/"+i+"/", callback1);}
- function callback1() {
- var a=this.toString().match(/[\w-]+(?=_tn1\.jpg)/gim);
- console.log(a.join("\n"));
- list1=list1.concat(a);
- post_imgur(a.map(url1), function() {
- console.log("imgur: " + (this.split("\n").length - 1), --stack);
- window.hl = this.toString()
- })
- // wallpapers/Island-Rock-La-Digue-Seychelles_tn1.jpg
- // http://www.mrwallpaper.com/wallpapers/Sunny-day-country-road.jpg
- }
- function url1(v){return "http://www.mrwallpaper.com/wallpapers/"+v+".jpg" }
- function post_imgur(a,callback) {
- var r=new XMLHttpRequest();
- r.open("POST","http://176.34.162.148/jabry/imgur1.asp?u=&b=",true);
- //r.open("POST","http://notebook1.lan:8000/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(","));
- }
- /* fetch url */
- function get_url(url,callback) {
- var r=new XMLHttpRequest();
- r.open("GET",url,true);
- r.onreadystatechange=function(){
- if (this.readyState==4 && this.status==200) callback.call(this.responseText);
- if (this.readyState==4) console.log(url);
- }
- r.send();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement