Created
November 7, 2017 06:25
-
-
Save chamakits/a0980ea8ce4d085426525df14275b042 to your computer and use it in GitHub Desktop.
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
javascript: function runDownloadThing(howManyToDownload) { | |
if (!howManyToDownload) { | |
howManyToDownload = 3; | |
} | |
if (window['downloadSome']) { | |
window.downloadSome(); | |
return; | |
} | |
var iter = $('div.download a.a:not([download])').toArray(); | |
iter = iter.concat($('div.row a[download]').toArray()); | |
window['downloadSome'] = (function() { | |
console.log("Downloads left: ", iter.length); | |
var someToDownload = iter.slice(0, howManyToDownload); | |
someToDownload.forEach(function(curr) { | |
curr.click(); | |
}); | |
iter = iter.slice(howManyToDownload); | |
}); | |
window.downloadSome(); | |
} | |
runDownloadThing(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment