[META] How to easily pull a list of all your un-redeemed games on humble bundle
I hope this is ok to post! Mods let me know if it isn't buttery!
So I put a big list of games up for sale here saying that if anyone wanted the JavaScript I used to pull the list to let me know. Multiple people said they were interested so I thought I would make a general post about it for anyone else who's interested!
This is a home-brewed, barely tested, being help together by duct tape sort of solution so if anyone else has a better one please post it! I learned JavaScript by stack-jacking and occasionally consulting the official documents and I barely use it on top of that!
Steps are easy though
- Open Chrome (That's all I tested this in, no idea if it will work anywhere else)
- Go to Humble Bundle and login
- In the upper right click your name and then select keys
- Click the Hide Keys check box (I tried to make the script do this on it's own but it never worked.)
- Right-click anywhere and select Inspect
- You will see a new panel pop-up (I believe by default it's along the bottom as pictured). Click the console button.
- Copy and paste the code below into your console and hit enter (I tried to comment the code as best I could so you could see it's 100% no bamboozles)
- Above where you entered the code you should now see a big list. You can copy and paste that out. The output should give you an alphabetized, Reddit formatted table ready to post!
If it throws an error try two things
- Uncheck and re-check the hide redeemed box
- Click on a page other than the page you're on (i.e. if you're on the first page of your games in humble go to the second page of games and try again).
Code
//if you're not on the first page navigate to the first page
if($('.js-jump-to-page:first').text() != "1"){
$('.js-jump-to-page:nth-child(2)').click()
}
// Find how many pages of games you have by getting the text inside the last page button
var loop = $('.js-jump-to-page:nth-last-child(2)').html()*1
// array to store all games found
var x = [];
// loop through each page
for(i=0;i<loop;i++){
// for each game on the page add an entry into the array
$('tbody tr').each(function(){
x.push('\n'+$(this).children('td.game-name').children('h4').attr('title')+' | '+$(this).children('td.platform').children('i').attr('title')+ '| Available |')
})
// click next page button
$('.js-jump-to-page:last').click()
}
// sort game list
x.sort()
// string variable for game list
var gamelist = ''
// transfer gamelist from array into string
x.forEach(function(x){gamelist += x})
// Output games with header needed for Reddit formatted table
console.log('Game | Platform | Available | Price\n---|---|---|---'+gamelist)
| Game | Platform | Available | Price |
|---|---|---|---|
| 10000000 | Steam | Available | |
| 1993 Space Machine | Steam | Available | |
| 2064: Read Only Memories | Steam | Available | |
| 230 Battleborn Platinum Currency | Battleborn | Available | |
| 7 Grand Steps | Steam | Available |
I hope that helped at least one of you!
Happy Baking all!!!
And as always, remember what the great prophets once said
1 GRLC = 1 Garlic Bread always and forever
Edit: Only because someone asked. I just made this to help the community!
GXtQpuHqAyJv36L1PJgEcA858ogZ4miZ44
Edit 2: If you use the code and it works do me a favor and spread the word by linking to this post in yours! Bake on!
Posted Jan 24, 2018, 12:54 AM UTC · edited