🚑 fix github parser

This commit is contained in:
platane
2023-01-09 08:19:20 +01:00
committed by Platane
parent 579bcf1afe
commit 6b34e9a272

View File

@@ -60,9 +60,13 @@ const parseUserPage = (content: string) => {
.toArray()
.map((x) => {
const level = +x.attribs["data-level"];
const count = +x.attribs["data-count"];
const date = x.attribs["data-date"];
const literalCount = $(x)
.text()
.match(/(No|\d+) contributions? on/)![1];
const count = literalCount === "No" ? 0 : +literalCount;
const color = colorScheme[level];
if (!color) throw new Error("could not determine the color of the cell");