Skip to content

Instantly share code, notes, and snippets.

@thebeardphantom
Last active August 29, 2015 14:15
Show Gist options
  • Save thebeardphantom/14a1c2ab6d69a832f29b to your computer and use it in GitHub Desktop.
Save thebeardphantom/14a1c2ab6d69a832f29b to your computer and use it in GitHub Desktop.
Steam Workshop Subscription Manager (SWSM)
javascript:(function(){ try { var version="1.1.3";var xmlHttp=null;xmlHttp=new XMLHttpRequest();xmlHttp.open("GET","https://api.github.com/gists/14a1c2ab6d69a832f29b",false);xmlHttp.send(null);var raw=xmlHttp.responseText;var json=JSON.parse(raw);if(json.files["version.txt"]["content"]!=version){prompt("There is a new version of SWSM. The latest script has been retrieved and is in the below text box. Edit your SWSM bookmarklet, replace the current URL value with the value below, and then rerun the bookmarklet.",json.files["SWSM.js"]["content"]);return;} } catch(err){} var unsubAll=false;var wl=window.location.toString();if(wl.toString().indexOf("browsefilter=mysubscriptions")==-1||wl.indexOf("steamcommunity.com")==-1){var uPrompt=prompt("Not on the correct page! Enter your steam username (not account name!). When the workshop page finishes loading, run this bookmarklet again.");if(uPrompt!=null){window.location="http://steamcommunity.com/id/"+uPrompt+"/myworkshopfiles?browsefilter=mysubscriptions&numperpage=30";}return;} alert("-=DISCLAIMER=-\n\nThe SWSM will allow you to mass-manage all CURRENTLY VISIBLE subscribed workshop items. This script will not assist you in undoing whatever you do WITH it. I take no responsibility for what you do with this. This script is provided free of charge.\n\nCreated by TheBeardPhantom");var buttons=document.querySelectorAll('*[id^=UnsubscribeItemBtn]');NextButton:for(var i=0;i<buttons.length;i++){var itemID=buttons[i].id.replace("UnsubscribeItemBtn","");if(unsubAll){UnsubscribeItem(itemID);continue NextButton;} var links=document.querySelectorAll('*[href$="'+itemID+'"]');for(var ii=0;ii<links.length;ii++){var l=links[ii];for(var iii=0;iii<l.childElementCount;iii++){var c=l.children[iii];if(c.className==="workshopItemTitle"){while(true){var action=prompt("Progress: "+(i+1)+"/"+buttons.length+"\nUnsubscribe from \""+c.innerText+"\"?\n\n1: Unsubscribe\n2: Skip\n3: Unsubscribe Rest\n\nClose this window to exit.");if(action==null){break NextButton;}else{action=action.trim();}if(action=="1"){UnsubscribeItem(itemID);continue NextButton;}else if(action=="2"){continue NextButton;}else if(action=="3"){unsubAll=true;UnsubscribeItem(itemID);continue NextButton;}}}}}} alert("Job finished. If you'd like to continue managing items, please go to the next page of subscribed items and run this bookmarklet again.");})()
@thebeardphantom
Copy link
Author

Create a new bookmark and use the above text as the URL!

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