Last active
February 28, 2025 14:25
-
-
Save peter9811/5cbca1535ed44dcebd5b9bb7dd65d227 to your computer and use it in GitHub Desktop.
Revisions
-
peter9811 renamed this gist
Feb 28, 2025 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
peter9811 created this gist
Sep 4, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ // Your Steam game IDs var gameIDs = [1549970, 440, 730]; // Replace with your game IDs // Get the session ID from cookies var sessionID = document.cookie.match(/sessionid=([^;]+)/)[1]; // Function to add games to the wishlist async function addToWishlist(gameIDs) { for (let i = 0; i < gameIDs.length; i++) { let appID = gameIDs[i]; await fetch('https://store.steampowered.com/api/addtowishlist', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: `appid=${appID}&sessionid=${sessionID}` }).then(response => { if (response.ok) { console.log(`Added appID: ${appID} to wishlist`); } else { console.error(`Failed to add appID: ${appID}`); } }).catch(error => console.error(`Error adding appID: ${appID}`, error)); await new Promise(resolve => setTimeout(resolve, 150)); // Delay to avoid triggering rate limits } console.log('All games processed'); } // Start the process addToWishlist(gameIDs);