Created
April 18, 2015 15:16
-
-
Save astyagun/6e4452fd3583133ab895 to your computer and use it in GitHub Desktop.
VK album photo links
This file contains hidden or 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
script = document.createElement('script'); | |
script.src = 'http://code.jquery.com/jquery-2.1.3.min.js'; | |
document.head.appendChild(script); | |
window.photoLinks = []; | |
function printLinks() { | |
$.each($.unique(window.photoLinks), function(i, link) { | |
console.log(link); | |
}); | |
} | |
function getLink(index) { | |
var anchors = $('#photos_container .photo_row a'); | |
if(index > anchors.length) { | |
printLinks(); | |
return; | |
} | |
$(anchors[index]).click() | |
setTimeout(function() { | |
window.photoLinks.push($('#pv_open_original').attr('href')); | |
getLink(index + 1); | |
}, 300); | |
} | |
setTimeout(function() {getLink(0)}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment