Skip to content

Instantly share code, notes, and snippets.

@KustoSan
Last active September 7, 2015 22:12
Show Gist options
  • Save KustoSan/19c56a191504873c6c2c to your computer and use it in GitHub Desktop.
Save KustoSan/19c56a191504873c6c2c to your computer and use it in GitHub Desktop.
Chrome Imgur album download script
i = 0;
while (i != $('.image').length) {
if ($('.image:eq(' + i + ')').attr('id') != undefined) {
link = $('.image:eq(' + i + ')').attr('id');
pic = 'http://i.imgur.com/' + link + '.jpg';
console.log('Downloading ' + pic)
// Construct the <a> element
var link = document.createElement("a");
link.download = pic + '.jpg';
// Construct the uri
var uri = pic
link.href = uri;
document.body.appendChild(link);
link.click();
// Cleanup the DOM
document.body.removeChild(link);
delete link;
}
i++
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment