🚑 fix github parser
This commit is contained in:
@@ -60,9 +60,13 @@ const parseUserPage = (content: string) => {
|
|||||||
.toArray()
|
.toArray()
|
||||||
.map((x) => {
|
.map((x) => {
|
||||||
const level = +x.attribs["data-level"];
|
const level = +x.attribs["data-level"];
|
||||||
const count = +x.attribs["data-count"];
|
|
||||||
const date = x.attribs["data-date"];
|
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];
|
const color = colorScheme[level];
|
||||||
|
|
||||||
if (!color) throw new Error("could not determine the color of the cell");
|
if (!color) throw new Error("could not determine the color of the cell");
|
||||||
|
|||||||
Reference in New Issue
Block a user