Skip to content

Instantly share code, notes, and snippets.

@azdle
Last active March 18, 2022 19:34
Show Gist options
  • Save azdle/7317289a6f0401b6a95e2b568bc1a806 to your computer and use it in GitHub Desktop.
Save azdle/7317289a6f0401b6a95e2b568bc1a806 to your computer and use it in GitHub Desktop.
Humble Bundle Easy Get All
//
// This scripts builds wget commands for you to paste into a terminal. It will download
// all formats of all books currently showing on the page.
//
cmds = "";
for (a of document.getElementsByTagName("a")) {
if (a.href.startsWith("https://dl.humble.com")) cmds += "wget --content-disposition '" + a.href + "'<br>";
};
// hack I can find no way to get FF to let me copy the full lines it's shortening them no matter what I do in the console
document.getElementById("addorder").innerHTML = cmds
//
// This script will generate a newline seperated list of game titles that you haven't
// revealed a key for from a bundle page for pasting into barter.gg
//
games = [];
for (block of document.getElementsByClassName("key-redeemer")) {
if (block.children.length == 3) {
let title = block.children[0].innerText;
let redeemed = block.children[1].classList.contains("redeemed");
let unrevealedSteamKey = block.children[1].innerText.includes("Reveal your Steam key");
if(unrevealedSteamKey) {
games.push(title);
}
}
}
games.join("\n")
@adius
Copy link

adius commented Feb 13, 2018

console.log should be replaced with console.dir, as it cuts of characters of the url!

@azdle
Copy link
Author

azdle commented May 30, 2018

Hmm, this used to work. I'm actually seeing it get cut off with with log and dir. Just returning (?) the string seems to work.

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