Last active
March 28, 2023 14:24
-
-
Save rgl/5d0a03ebd4efd87159997c64cb04b898 to your computer and use it in GitHub Desktop.
scrape uupdump.net for a windows server 2022 iso creation pack
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
// scrape https://uupdump.net/known.php?q=feature+update+server+operating+system+20348+amd64 | |
// NB there's a better way, using the API, e.g. https://api.uupdump.net/listid.php?search=feature+update+server+operating+system+20348+amd64 | |
// see https://github.com/uup-dump/json-api | |
// see https://github.com/uup-dump/website/blob/master/known.php | |
// see https://github.com/uup-dump/website/blob/master/get.php | |
// each scraped line is a tab separated string with 4 fields alike: | |
// "Feature update to Microsoft server operating system, version 21H2 (20348.643) amd64\tx64\t2022-04-12 17:04:01 UTC\tb8e204fd-4e2b-4722-95d7-aad633ad7379" | |
const updateIdEl = Array.prototype.find.call(document.querySelectorAll('th'), el => el.innerText == "Update ID"); | |
const buildsTableEl = updateIdEl.parentElement.parentElement.parentElement; | |
const builds = buildsTableEl.querySelector('tbody').innerText | |
.split("\n") | |
.map(l => l.split("\t")) | |
.map(a => { | |
const name = a[0]; | |
const matches = name.match(/ \((\d+\.\d+)\) [a-z0-9]+$/); | |
const version = matches[1]; | |
return { | |
name: name, | |
version: version, | |
architecture: a[1], | |
dateAdded: a[2], | |
id: a[3], | |
}; | |
}); | |
// then you can use the builds to create the download package at, e.g., to | |
// get the download package that gets the serverstandard edition: | |
// https://uupdump.net/get.php?id=b8e204fd-4e2b-4722-95d7-aad633ad7379&pack=en-us&edition=serverstandard | |
// NB edition is a semicolon separated list, at most it can be: | |
// serverdatacenter;serverdatacentercore;serverstandard;serverstandardcore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment