Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(2 edits) (+2)

I have a slight modification since the search bar that was added messes up the var games = document.getElementsByClassName("form"); array.

it uses jQuery to find and iterate since it's available.

I made some tweaks so that it will log the name of the game just added and will do all of them in order so it's easy to tell when it's done. NOTE: this does make it so you can't click anything on the page while it runs.


baseURL = window.location.protocol + "//" + window.location.host + location.pathname
$('.game_list').find('form[method=POST]').each(function(index,form){
    var csrf_token = $(form).find('input[name=csrf_token]').val()
    var game_id = $(form).find('input[name=game_id]').val()
    try{
        var xhr = new XMLHttpRequest();
        xhr.open("POST", baseURL, false);
        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        xhr.send("csrf_token=" + csrf_token + "&game_id=" + game_id + "&action=claim");
    } catch(error){
        //console.log(error);
    }
    var game_title = $(form).parents('.game_row_data').find('.game_title').text()
    console.log("added number",index+1, game_title)
})


Does anyone happen to know if newly added games are always added to the last page? If they aren't it might be tricky to find and add those among the ones you've already claimed.

God bless you. Thank you!!!!!.

I double checked the last download page and there was this note at the top:

"Note: We will be updating this page soon, we know it's difficult to navigate so many games. We know you want a button to add show everything in your library. No need to reach out. Any new games added to the bundle will automatically show up here. Thanks!"

so you might not need to bother with the scripts soon.

Hi,
when I run your script in the console, every addition is printed, but it does not appear in my collection.
Any thoughts?

I always forget about cross-browser compatibility.  I just tried it in Edge and Firefox and it unfortunately didn't work. I don't really have the time to debug it, I'm sorry.

It should run if you use Google Chrome though.

Thank you for this!