Created
June 24, 2024 20:29
-
-
Save ThatGravyBoat/99a6b44e9affc3dfac863b54ae66c8d9 to your computer and use it in GitHub Desktop.
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
<html> | |
<body> | |
<h1>Changelog</h1> | |
</body> | |
<script defer> | |
const REGEX = /`(\d+\.\d+\.\d+)` (.*)/; | |
fetch("https://maven.neoforged.net/releases/net/neoforged/neoforge/maven-metadata.xml") | |
.then(response => response.text()) | |
.then(data => { | |
const parser = new DOMParser(); | |
const xml = parser.parseFromString(data, "text/xml"); | |
const version = xml.querySelector("latest").textContent; | |
fetch(`https://maven.neoforged.net/releases/net/neoforged/neoforge/${version}/neoforge-${version}-changelog.txt`) | |
.then(response => response.text()) | |
.then(data => { | |
const lines = data.replace("\n", "").split(" - "); | |
const ul = document.createElement("ul"); | |
for (const line of lines) { | |
if (line.trim().length === 0) continue; | |
const match = line.match(REGEX); | |
if (match === null) continue; | |
const li = document.createElement("li"); | |
const version = document.createElement("strong"); | |
version.textContent = match[1]; | |
li.appendChild(version); | |
li.appendChild(document.createTextNode(" " + match[2])); | |
ul.appendChild(li); | |
} | |
document.body.appendChild(ul); | |
}); | |
}); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment