Last active
March 18, 2022 19:34
-
-
Save azdle/7317289a6f0401b6a95e2b568bc1a806 to your computer and use it in GitHub Desktop.
Humble Bundle Easy Get All
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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") |
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
console.log
should be replaced withconsole.dir
, as it cuts of characters of the url!