Skip to content

Instantly share code, notes, and snippets.

@papuSpartan
Forked from Saturate/README.md
Last active November 10, 2022 00:41
Show Gist options
  • Save papuSpartan/2e72ec819b9c1a6fd2736386ae179e1d to your computer and use it in GitHub Desktop.
Save papuSpartan/2e72ec819b9c1a6fd2736386ae179e1d to your computer and use it in GitHub Desktop.
Generate Workshop Items from Steam Workshop Collection

Generate Workshop Items from Steam Workshop Collection

This snippet will generate a list suited for the Project Zomboid config from a Steam Workshop Collection, but can also be used for other formats. Just change the separator variable in order to suit your needs.

How to use:

  1. Navigate to your collection (eg. https://steamcommunity.com/sharedfiles/filedetails/?id=2871262277)
  2. Copy the code in console.js
  3. Open the devtools for your browser (F12)
  4. Paste and run the code
  5. Copy the output
  6. Paste the config line into your config.

The output will look like this:

WorkshopItems=2625625421;2619072426;2423906082;2618213077;2522173579;2870394916;2846036306;2811383142;2805630347;2772575623;2642541073;2566953935;2516123638;2489148104;2441990998;2169435993;2478768005;2392709985;2490220997
var separator = "\n"
var sWorkshopPrefix = "https://steamcommunity.com/sharedfiles/filedetails/?id="
var modIds = Array.from(document.querySelectorAll('[id^="sharedfile_"]')).map(mod => {
return mod.id.replace('sharedfile_','');
})
var links = ""
for (var i = 0; i < modIds.length; i++) {
links += (sWorkshopPrefix+modIds[i]+"\n")
}
console.log("Workshop Item Links:\n")
console.log(links)
console.log("Raw Ids:")
console.log(`${modIds.join(separator)}`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment