Advertisement
rg443

fc_preview (30882578)

May 6th, 2013
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var j= j||31539835;
  2. function grid_preview(start){
  3. if (!start) start=31407443;
  4. for (var a=[],i=start;i>start-450;i--) {a.push('<img src="http://i'+ i%3 + '.wp.com/img.fotocommunity.com/photos/'+i+'.jpg?resize=320,200" style="width:320px;height:200px" onerror="rem3(this)" />'); if (i==1) break;}
  5. // cdn.fotocommunity.com/qthumb/
  6. window.stop();
  7. document.body.innerHTML=a.join("");
  8. document.body.insertAdjacentHTML("beforeEnd",'<br><a href="#" onclick="grid_preview(j-=450);setTimeout(window.scroll,200,0,0);return false;" style="font:menu;font-size:14pt;color:black;text-decoration:none;">more</a>');
  9.  
  10. document.body.insertAdjacentHTML("beforeEnd",'<a href="#" onclick="grid_preview(j+=450);setTimeout(window.scroll,200,0,0);return false;" style="font:menu;font-size:9pt;color:black;text-decoration:none;margin-left:10px;" title="scroll back"> scroll back </a>');
  11.  
  12. document.body.insertAdjacentHTML("beforeEnd",'<a href="#" onclick="latest();setTimeout(window.scroll,500,0,0);return false;" style="font:menu;font-size:9pt;color:black;text-decoration:none;margin-left:5px;" title="latest"> latest </a>');
  13.  
  14. document.title="fc - " +start;
  15. /*
  16.    http://cdn.fotocommunity.com/photos/30881781.jpg 1000,
  17.    http://cdn.fotocommunity.com/qthumb/30881781.jpg 240,240
  18.    http://cdn.fotocommunity.com/thumbs/30881781.jpg 120,80
  19. */
  20.  
  21. }
  22. function latest(callback){
  23.    
  24.    var r=new XMLHttpRequest();
  25.    r.open("GET","http://query.yahooapis.com/v1/public/yql?q=select * from html where url = 'http://www.fotocommunity.de/fotos-neu-international'",true);
  26.    r.onload=function(){
  27.       var re=/display\/(\d+)/gim,m=null,latest=-1;
  28.       while(m=re.exec(this.responseText)) (latest<m[1])&&(latest=parseInt(m[1]))
  29.       console.log(latest);
  30.       latest&&(localStorage["fc.latest"]=[Math.floor(new Date().getTime()/1000),latest]);
  31.       latest&&callback&&callback.call(latest);
  32.       latest&&grid_preview(latest);
  33.       latest&&(j=latest);
  34.    }
  35.    r.send();
  36. }
  37.  
  38. function rem1(el){setTimeout(function(){el.parentElement.removeChild(el)},100);}
  39. function rem2(el){el.style.display="none";}
  40. function rem3(el){el.style.visibility="hidden";}
  41.  
  42. grid_preview(j);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement