Skip to content

Commit 3fb2841

Browse files
committed
Sync Swiss PSUG Meetup event
1 parent 97a1254 commit 3fb2841

3 files changed

Lines changed: 34 additions & 10 deletions

File tree

.github/scripts/sync-meetup-events.mjs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,19 @@ function eventSchema(html, url) {
7676

7777
function eventMetadata(event) {
7878
const virtual = /(?:Online|Mixed)EventAttendanceMode$/.test(event.eventAttendanceMode ?? '');
79-
if (virtual && event.location?.['@type'] === 'VirtualLocation') {
80-
return { virtual, where: 'Online' };
81-
}
79+
const locations = Array.isArray(event.location) ? event.location : [event.location].filter(Boolean);
80+
const place = locations.find(({ '@type': type }) => type === 'Place');
81+
82+
if (!place) return { virtual, where: virtual ? 'Online' : '' };
8283

83-
const address = event.location?.address;
84+
const address = place.address;
8485
const addressParts = typeof address === 'string'
8586
? [address]
8687
: [address?.streetAddress, address?.addressLocality, address?.addressRegion, address?.addressCountry];
87-
const where = [event.location?.name, ...addressParts].filter(Boolean).join(', ');
88+
const where = [place.name, ...addressParts].filter(Boolean).reduce(
89+
(parts, part) => parts.some((existing) => existing.toLowerCase().includes(part.toLowerCase())) ? parts : [...parts, part],
90+
[],
91+
).join(', ');
8892
return { virtual, where };
8993
}
9094

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ npm run dev
3232
This serves the site at `http://localhost:1313` with hot-reload and draft posts
3333
visible. Save your Markdown file and the browser updates automatically.
3434

35+
### Syncing Meetup user-group events
36+
37+
The Community Calendar automatically syncs upcoming events from configured
38+
Meetup groups. Add the group's Meetup URL name to
39+
[`data/meetup_groups.json`](data/meetup_groups.json), then verify its public
40+
`https://www.meetup.com/<urlname>/events/ical/` feed contains the intended
41+
events. The scheduled **Sync Meetup Events** workflow reads that public feed
42+
and its linked event pages; no Meetup API key or OAuth token is required.
43+
44+
To preview the generated calendar changes locally without writing files:
45+
46+
```bash
47+
node .github/scripts/sync-meetup-events.mjs --dry-run
48+
```
49+
3550
## What the site includes
3651

3752
- **Home** — community stats and the latest content.

content/calendar/swiss-psug-09-2026-2026.md renamed to content/calendar/meetup-315958850.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
---
2-
endDate: '2026-09-09'
3-
externalUrl: https://www.meetup.com/swiss-powershell-user-group/events/315958850/
4-
startDate: '2026-09-09'
5-
title: Swiss PSUG 09/2026
2+
meetupEventId: "315958850"
3+
meetupSource: meetup
4+
startDate: "2026-09-09"
5+
title: "Swiss PSUG 09/2026"
6+
externalUrl: "https://www.meetup.com/swiss-powershell-user-group/events/315958850/"
67
virtual: true
7-
where: Bern, Switzerland
8+
where: "isolutions AG, Schanzenstrasse 4c, Bern"
89
---
10+
Swiss PowerShell User Group
11+
Dear Swiss PSUG,
12+
We have planned another exciting event.
13+
914
**Place & Language:**
1015
Place: Isolutions AG, Schanzenstrasse 4c, 3008 Bern (Hybrid with Teams)
1116
Language: EN

0 commit comments

Comments
 (0)