From e129ffa7c316788c05f9c73c835c434132bd19e6 Mon Sep 17 00:00:00 2001 From: Clarence Chan <69307556+clarencechaan@users.noreply.github.com> Date: Tue, 1 Apr 2025 17:13:47 -0400 Subject: [PATCH 1/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 965d4f6c..2c7e165e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This feed is not affiliated with the UFC. The three biggest points that this aims to address, which I found lacking in other calendar feeds: -- **Always kept up to date**: events are added and card details are updated within a day of the UFC posting an event or adding/removing fights to/from a previously announced event +- **Always kept up to date**: events are added and card details are updated within a day of any changes posted by the UFC, including new events, fight additions, or removals - **Event times are accurate**: event times reflect your local timezone, and always match the times posted by the UFC - **Card details**: without leaving your calendar, you can see every (announced) fight on the card, whether it's on the main card, prelims, or early prelims From 95a9ffd9778f1bffdd1dd3380513b2db5d072101 Mon Sep 17 00:00:00 2001 From: Clarence Chan Date: Sat, 3 May 2025 13:16:40 -0400 Subject: [PATCH 2/2] Add placeholder for missing fighter names --- src/scrape.ts | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/scrape.ts b/src/scrape.ts index 874007fa..77297a43 100644 --- a/src/scrape.ts +++ b/src/scrape.ts @@ -86,17 +86,18 @@ function convertLiToStr(li: HTMLElement) { else if (bout.includes("Catchweight")) weightClass = "CW"; // Extract and format fighter names with weightclass - const red = li - .querySelector(".c-listing-fight__corner-name--red") - ?.textContent?.replaceAll("\n", "") - .replace(/\s+/g, " ") - .trim(); - const blue = li - .querySelector(".c-listing-fight__corner-name--blue") - ?.textContent?.replaceAll("\n", "") - .replace(/\s+/g, " ") - .trim(); - if (!red || !blue) throw new Error("Failed to retrieve fighter names"); + const red = + li + .querySelector(".c-listing-fight__corner-name--red") + ?.textContent?.replaceAll("\n", "") + .replace(/\s+/g, " ") + .trim() || "___"; + const blue = + li + .querySelector(".c-listing-fight__corner-name--blue") + ?.textContent?.replaceAll("\n", "") + .replace(/\s+/g, " ") + .trim() || "___"; const ranks = li .querySelectorAll(