Skip to content

Instantly share code, notes, and snippets.

@JoshuaVandaele
Last active October 26, 2020 03:15
Show Gist options
  • Select an option

  • Save JoshuaVandaele/96eec4723595b232718261f23a859d07 to your computer and use it in GitHub Desktop.

Select an option

Save JoshuaVandaele/96eec4723595b232718261f23a859d07 to your computer and use it in GitHub Desktop.
Grabs all free game's app ids in Steam, requires steam inventory helper to check if you already have the game or not, but not obligatory
//Use on https://store.steampowered.com/search/
//By Folfy Blue
function startLoadingGames() {
var scroll = setInterval(function(){ window.scrollBy(0,1000000); }, 1000); //load new games by scrolling down
}
function listFreeGames() {
for(var i = 0; i < 10000; i++) {
window.clearInterval(i);
}
console.clear();
var inputs = document.getElementsByClassName("search_result_row ds_collapse_flag app_impression_tracked"); //Get all of steam's displayed ganes
for(var i = 0; i < inputs.length; i++) {
// Only if there is only single class
if(inputs[i].className == "search_result_row ds_collapse_flag app_impression_tracked") { //if don't have the game yet
if (inputs[i].getElementsByClassName("col search_price_discount_combined responsive_secondrow").item(0).dataset.priceFinal == "0") { //if free
console.log("a/"+inputs[i].dataset.dsAppid + ","); //log it
}
}
}
inputs = null;
}
document.body.addEventListener('click', listFreeGames, true);
//Use startLoadingGames() to start
//Use listFreeGames() or click anywhere to get the free games app IDs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment