https://steamcommunity.com/sharedfiles/filedetails/?id=1746978201
Created
August 22, 2023 21:56
-
-
Save Ravendwyr/5df9416412d55d0ca3964b75fd2ca3ec to your computer and use it in GitHub Desktop.
Remove Unlisted Games from Steam Wishlist
This file contains 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
console.log('This software is Licensed under GNU GPLv3 Copyright © "2020" - Sean "The HopelessGamer".'); | |
let removed = 0, result, modalTitle = "Remove Unlisted Games"; | |
wishlistData = g_rgWishlistData.filter(function (wishlistItem) { | |
return !g_Wishlist.rgVisibleApps.find(function (appId) { | |
return appId == wishlistItem.appid; | |
}); | |
}); | |
let plural = " "; | |
if (wishlistData.length > 1) { | |
plural = "s "; | |
} | |
async function cleanWishlist() { | |
for (removed = 0; removed < wishlistData.length; removed++) { | |
results = await fetch(g_strWishlistBaseURL + 'remove/', { | |
body: `appid=${wishlistData[removed].appid}&sessionid=${g_sessionID}`, | |
headers: { | |
"Content-Type": "application/x-www-form-urlencoded" | |
}, | |
method: "POST" | |
}); | |
} | |
setTimeout(function(){location.reload()}, 500); | |
} | |
if (wishlistData.length !== 0) { | |
if (wishlistData.length > 50) { | |
let modalDescription = "Removing " + wishlistData.length + " game" + plural + "is not recommended. Steam may rate limit your IP temporarily. Are you sure you would like to proceed?"; | |
let Modal = ShowConfirmDialog(modalTitle, modalDescription); | |
Modal.done(function(result) { | |
if (result == 'OK') { | |
cleanWishlist(); | |
} | |
}); | |
} else { | |
let modalDescription = "You are about to remove " + wishlistData.length + " unlisted game" + plural + "from your wishlist! Are you sure you would like to proceed?"; | |
let Modal = ShowConfirmDialog(modalTitle, modalDescription); | |
Modal.done(function(result) { | |
if (result == 'OK') { | |
cleanWishlist(); | |
} | |
}); | |
} | |
} else { | |
ShowDialog("No Unlisted Games Found"); | |
} |
This file contains 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
$J.post(g_strWishlistBaseURL + 'remove/', { | |
'appid': 0, /* Replace the 0 with the appid of the game you wish to remove */ | |
'sessionid': g_sessionID | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment