Created
September 15, 2016 01:07
-
-
Save pettazz/5975b296fe3bbe187e856f73d7eeda67 to your computer and use it in GitHub Desktop.
get all the urls from a wedding photo website because im lazy and i wanted to download them all
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var urls = []; | |
var thumbs = $('.tab-frame-content .pg img.pv-img'); | |
var doit = function(idx){ | |
if(idx < thumbs.length){ | |
var el = $(thumbs[idx]); | |
var link = el.parent('a'); | |
link.trigger('mousedown'); | |
var timeoutID = window.setTimeout(function(){ | |
$('.pf-plane > .pv-ready .pv-inner > img.pv-img').each(function(){ | |
var style = $(this).attr('style'); | |
if(style){ | |
urls.push(style.match(/(?:"[^"]*"|^[^"]*$)/)[0].replace(/"/g, "")); | |
} | |
}); | |
doit(idx + 1) | |
}, 2000); | |
}else{ | |
if($("a#_aab-n").css("visibility") !== "hidden"){ | |
$("a#_aab-n").trigger('mousedown'); | |
var timeoutID = window.setTimeout(function(){ | |
thumbs = $('.tab-frame-content .pg img.pv-img'); | |
doit(0); | |
}, 4000); | |
}else{ | |
console.log(urls); | |
} | |
} | |
}; | |
doit(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pics.json
There's probably a more clever way to rename with curl but did I mention I am laaaaaaaaaazy