mirror of
https://github.com/clarencechaan/ufc-cal.git
synced 2026-10-19 18:10:58 -07:00
Fix location formatting
This commit is contained in:
1 parent
95a9ffd977
commit
22bef75c69
1 file changed
+7
-2
+7
-2
@@ -147,8 +147,11 @@ async function getDetailsFromEventURL(url: URL) {
|
|||||||
let location =
|
let location =
|
||||||
root
|
root
|
||||||
.querySelector(".field--name-venue")
|
.querySelector(".field--name-venue")
|
||||||
?.innerText.replaceAll("\n", "")
|
?.innerText.replaceAll(",", "")
|
||||||
.replaceAll(" ", " ") || "";
|
.split("\n")
|
||||||
|
.filter((str) => str)
|
||||||
|
.map((str) => str.trim())
|
||||||
|
.join(", ") || "";
|
||||||
let fightCard: string[] = [];
|
let fightCard: string[] = [];
|
||||||
let mainCard: string[] = [];
|
let mainCard: string[] = [];
|
||||||
let prelims: string[] = [];
|
let prelims: string[] = [];
|
||||||
@@ -231,3 +234,5 @@ async function getAllDetailedEvents() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export { getAllDetailedEvents };
|
export { getAllDetailedEvents };
|
||||||
|
|
||||||
|
getDetailsFromEventURL(new URL("https://www.ufc.com/event/ufc-312"));
|
||||||
Reference in new issue
Block a user