Skip to content

Instantly share code, notes, and snippets.

@ThatGravyBoat
Created June 24, 2024 20:29
Show Gist options
  • Save ThatGravyBoat/99a6b44e9affc3dfac863b54ae66c8d9 to your computer and use it in GitHub Desktop.
Save ThatGravyBoat/99a6b44e9affc3dfac863b54ae66c8d9 to your computer and use it in GitHub Desktop.
<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