Skip to content

Instantly share code, notes, and snippets.

@WynterFoxx
Forked from dob9601/humble_download_trove.js
Last active September 9, 2018 02:16
Show Gist options
  • Save WynterFoxx/bcd030a811d408d74981f3a0f2e0e19e to your computer and use it in GitHub Desktop.
Save WynterFoxx/bcd030a811d408d74981f3a0f2e0e19e to your computer and use it in GitHub Desktop.
Download the whole of the humble trove (if you have subscribed to the humble trove)
let buttons = document.getElementsByClassName("js-download-button");
let i = 0;
let interval = setInterval(() => {
if(i > buttons.length)
{
clearInterval(interval);
}
else{
buttons[i].click();
console.log(++i)
console.log('Downloading: '+buttons[i - 1].parentNode.parentNode.parentNode.children[0].children[0].children[0].innerHTML);
}
}, 1000);
@WynterFoxx
Copy link
Author

WynterFoxx commented Sep 9, 2018

Additional quick edit, switched if/else statements, moved console.log(i++) and replaced i++ with ++i.
Console now returns the value of i before the Downloading message, and starts at 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment