2 Commits

Author SHA1 Message Date
922a8d24dd Set user agent when requesting iCal
All checks were successful
Build Production Image / Build Production Image (push) Successful in 1m5s
2024-05-21 19:57:31 -07:00
7192f527e9 Add Linn as director
All checks were successful
Build Production Image / Build Production Image (push) Successful in 1m15s
2024-04-27 14:22:31 -07:00
2 changed files with 11 additions and 1 deletions

View File

@ -95,6 +95,10 @@ export default function Club() {
<TableLeftHeading>Leslie Brown</TableLeftHeading>
<TableCell>Director</TableCell>
</tr>
<tr>
<TableLeftHeading>Linn Hulley</TableLeftHeading>
<TableCell>Director</TableCell>
</tr>
</tbody>
</table>
</div>

View File

@ -44,7 +44,13 @@ async function loadCalendar(): Promise<void> {
return;
}
const icalContents = await (await fetch(icalAddr)).text();
console.log("Refreshing iCal from Google Calendar")
// For some reason Google Calendar is sending different content based on who is requesting it.
const headers = new Headers();
headers.set('User-Agent', 'curl/7.54.1');
const icalContents = await (await fetch(icalAddr, { headers })).text();
const events = ical.parseICS(icalContents);
const thisMonth = dayjs().startOf('month');
const yesterday = dayjs().startOf('day').subtract(1, 'day');