Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. var images = [];
  2.  
  3. function getPhoto() {
  4. var img = document.querySelector('.spotlight');
  5. console.log(images.length, img.src);
  6. var hasImage = images.indexOf(img.src) !== -1
  7. if (!hasImage) {
  8. images.push(img.src);
  9. var currentSrc = img.src;
  10. document.querySelector('.snowliftPager.next').click();
  11. var interval = setInterval(function() {
  12. var loading = document.querySelector('.spotlight');
  13. if (loading.src !== currentSrc && loading.complete) {
  14. clearInterval(interval);
  15. getPhoto();
  16. }
  17. }, 100);
  18. } else {
  19. console.log('all done');
  20. window.wget = images.map(function(image) {
  21. return 'wget --no-check-certificate "' + image + '"';
  22. });
  23. window.wget.map(function(line) {console.log(line); });
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement