Skip to content

Instantly share code, notes, and snippets.

@PabloWestphalen
Created January 19, 2019 19:02
Show Gist options
  • Save PabloWestphalen/c5f16b551dc33fa66ca8e0e2f3009e62 to your computer and use it in GitHub Desktop.
Save PabloWestphalen/c5f16b551dc33fa66ca8e0e2f3009e62 to your computer and use it in GitHub Desktop.
(
function() {
let div = '<div id="progress" style="position: fixed; z-index: 1000; background-color: #424c59; padding: 1em; bottom: 1em; left: 1em; border-radius: 4px; box-shadow: 1px 2px 12px 0 black">Clearing wishlist...</div>';
document.querySelector("body").innerHTML+=div;
let progress = document.getElementById("progress");
let promises = [], count = 0;
for (let id of g_Wishlist.rgAllApps) {
let form = new FormData();
form.append('sessionid', g_sessionID);
form.append('appid', id);
promises.push(fetch(g_strWishlistBaseURL+'remove', {method: 'POST', body: form}).then(() => {
let msg = "removed app "+id+", total removed: "+count;
console.log(msg);
progress.innerHTML=msg;
count++;
}));
}
Promise.all(promises).then(() => {
console.log("done removing. refreshing...");
progress.parentNode.removeChild(progress);
location.reload();
});
}
)();
@TBBle
Copy link

TBBle commented Oct 19, 2022

Thank you for this. I tried it, and it hit a rate-limit, but it's certainly a useful start.

For anyone else that stumbles upon this, there's a serial version of roughly the same idea at https://www.reddit.com/r/Steam/comments/ah9as8/comment/eecsutc/. It seems to get through about 4 per second right now, so if you can wait, or your wishlist is small, that might be simple-enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment