Skip to content

Instantly share code, notes, and snippets.

@tlc
tlc / humble_bundle_file_downloader.js
Last active March 25, 2020 08:58 — forked from Woody2143/humble_bundle_file_downloader.js
Download HumbleBundle book bundles easier. Puts 'curl' statements on the page for you to copy.
/* 11/27/2017 - Tweaked for a page redesign.
* 1/6/2018 - Handle videos in book bundle.
*/
var pattern = /(MOBI|EPUB|PDF( ?\(H.\))?|CBZ)$/i;
var pattern2 = /(Download)$/;
var nodes = document.getElementsByTagName('a');
var downloadCmd = '';
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim())) {