mirror of
https://github.com/clarencechaan/ufc-cal.git
synced 2026-10-19 00:38:30 -07:00
Implement getDetailedEvents function in scrape.js
This commit is contained in:
1 parent
c59f806938
commit
20657984a2
1 file changed
+15
@@ -71,3 +71,18 @@ async function getDetails(event) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
async function getDetailedEvents() {
|
||||
let events = [];
|
||||
|
||||
try {
|
||||
events = await searchEvents();
|
||||
events = events.map((event) => getDetails(event));
|
||||
events = await Promise.all(events);
|
||||
return events;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
getDetailedEvents();
|
||||
Reference in new issue
Block a user