Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- city 709
- animals 1172
- macro 493
- landscapes 2705
- nature 784
- moods 473
- flowers 525
- stuff 1502
- */
- var stack=0;
- //for (var i=1;i<=1502;i++){stack++;setTimeout(get_url,i*150,"http://www.gdefon.com/stuff/page/"+i, callback1);}
- for (var i=1;i<=500;i++){stack++;setTimeout(get_url,i*150,"http://www.gdefon.com/page/"+i, callback1);} // latest submitions
- function callback1() {
- var a = this.match(/http\S+\.jpg/gim).map(function(v) {
- return v.replace("wallpapers_preview", "wallpapers_original").replace("(www.GdeFon.ru)", "")
- });
- //console.log(a.join("\n"));
- post_imgur(a, function() {
- console.log("imgur: " + (this.split("\n").length - 1), --stack);
- window.hl = this.toString()
- })
- }
- ;
- /* 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.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);
- }
- r.send();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement