Skip to content

Commit 6b34e9a

Browse files
committed
🚑 fix github parser
1 parent 579bcf1 commit 6b34e9a

File tree

1 file changed

+5
-1
lines changed
  • packages/github-user-contribution

1 file changed

+5
-1
lines changed

‎packages/github-user-contribution/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,13 @@ const parseUserPage = (content: string) => {
6060
.toArray()
6161
.map((x) => {
6262
const level = +x.attribs["data-level"];
63-
const count = +x.attribs["data-count"];
6463
const date = x.attribs["data-date"];
6564

65+
const literalCount = $(x)
66+
.text()
67+
.match(/(No|\d+) contributions? on/)![1];
68+
const count = literalCount === "No" ? 0 : +literalCount;
69+
6670
const color = colorScheme[level];
6771

6872
if (!color) throw new Error("could not determine the color of the cell");

0 commit comments

Comments
 (0)