Skip to content

Instantly share code, notes, and snippets.

@rmp135
Last active August 18, 2017 10:32
Show Gist options
  • Save rmp135/b29de765f8f8c0685d1efb6d6035dfc6 to your computer and use it in GitHub Desktop.
Save rmp135/b29de765f8f8c0685d1efb6d6035dfc6 to your computer and use it in GitHub Desktop.
Extracts redeemable game keys
// For use on https://www.humblebundle.com/home/keys
"Game\tRedeemed\tStore\tCreated\n" +
Object.keys(localStorage)
.filter(k => k.includes("v1/order"))
.map(k => JSON.parse(LZString.decompress(localStorage[k])).tpkd_dict.all_tpks)
.reduce((p1, p2) => p1.concat(p2))
.filter(p => p !== undefined)
.map(p => `${p.human_name}\t${p.redeemed_key_val != null}\t${p.key_type_human_name}\t${p.created}`)
.join("\r\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment