Last active
October 26, 2020 03:15
-
-
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
This file contains hidden or 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
| //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