Skip to content

Instantly share code, notes, and snippets.

@camillevilla
Last active June 13, 2018 22:02
Show Gist options
  • Save camillevilla/f812118fc0ef1f4df8728395702f16bc to your computer and use it in GitHub Desktop.
Save camillevilla/f812118fc0ef1f4df8728395702f16bc to your computer and use it in GitHub Desktop.
Bulk download humble bundle files
// Here ya go, dad! 2018-06-10
// Open Firefox
// Options / Preferences --> Tabs --> Open links in tabs instead of new windows
// Options / Preferences --> Applications --> PDF, Action: Save file
// Allow pop-ups from humblebundle.com
// With your Humble Bundle purchases tab open in Firefox:
// Firefox --> Web Tools --> Web Console
// Click the "Raw" button on this GitHub page and paste in the stuff below
// If you want to grab other files, replace "PDF" with "EPUB" or "MOBI"
var spans =Array.from(document.getElementsByClassName('label'))
spans = spans.filter(span => span.textContent == "PDF")
var links = spans.map((span) => span.nextElementSibling)
function openInNewTab(url) {
var win = window.open(url, '_blank');
}
links.forEach((link) => openInNewTab(link))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment