Skip to content

Instantly share code, notes, and snippets.

@dakni
dakni / hb_all_books_dl.js
Last active July 22, 2017 19:27 — forked from graymouser/hb_all_books_dl.js
Humble bundle book bundles - download all books at once -- wget approach
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window (Ctrl-Shift-K) for the page and paste in the below javascript
*/
var pattern = /(MOBI|EPUB|PDF|PDF \(HQ\))$/i;
var nodes = document.getElementsByTagName('a');
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim())) {
download(a.attributes['data-web'].value, i);