From 72be48558c5c99fa4d67bf22f5efb8004b7844bd Mon Sep 17 00:00:00 2001 From: Sebb Date: Wed, 17 Apr 2024 17:24:00 +0100 Subject: [PATCH 01/19] Drop embed --- source/event/calendar.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/event/calendar.md b/source/event/calendar.md index 5f40950..d830eb4 100644 --- a/source/event/calendar.md +++ b/source/event/calendar.md @@ -5,8 +5,7 @@ title: Apache Conferences Calendar This Calendar is maintained by the [Apache Conferences Committee][1] (ConCom). It's used to list official Apache events, and those events which have been approved to use Apache Marks under the [Third Party Event Branding Policy][2]. - +https://www.google.com/calendar/ This Calendar is also available as an [iCal feed][3] From af5aeefa087c44befb30df4fe43ee033855a118f Mon Sep 17 00:00:00 2001 From: Sebb Date: Wed, 17 Apr 2024 17:35:32 +0100 Subject: [PATCH 02/19] Link was mangled --- source/event/calendar.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/event/calendar.md b/source/event/calendar.md index d830eb4..19c6a3b 100644 --- a/source/event/calendar.md +++ b/source/event/calendar.md @@ -5,7 +5,7 @@ title: Apache Conferences Calendar This Calendar is maintained by the [Apache Conferences Committee][1] (ConCom). It's used to list official Apache events, and those events which have been approved to use Apache Marks under the [Third Party Event Branding Policy][2]. -https://www.google.com/calendar/ +The calendar is available [from https://www.google.com][4]: This Calendar is also available as an [iCal feed][3] @@ -13,3 +13,4 @@ This Calendar is also available as an [iCal feed][3] [1]: https://www.apache.org/foundation/conferences.html [2]: https://www.apache.org/foundation/marks/events.html [3]: https://www.google.com/calendar/ical/nerseigospses068jd57bk5ar8%40group.calendar.google.com/public/basic.ics + [4]: https://www.google.com/calendar/embed?src=nerseigospses068jd57bk5ar8%40group.calendar.google.com&ctz=UTC From e9e918f2c781d0b4810b86d1f7248e3e5e85df6c Mon Sep 17 00:00:00 2001 From: Sebb Date: Wed, 17 Apr 2024 17:39:49 +0100 Subject: [PATCH 03/19] Trigger build --- source/event/calendar.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/event/calendar.md b/source/event/calendar.md index 19c6a3b..07c1786 100644 --- a/source/event/calendar.md +++ b/source/event/calendar.md @@ -5,7 +5,7 @@ title: Apache Conferences Calendar This Calendar is maintained by the [Apache Conferences Committee][1] (ConCom). It's used to list official Apache events, and those events which have been approved to use Apache Marks under the [Third Party Event Branding Policy][2]. -The calendar is available [from https://www.google.com][4]: +The calendar is available [from https://www.google.com][4] This Calendar is also available as an [iCal feed][3] From 921e937c09aa1a93348468ccba2e8c3f222cec87 Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 00:19:01 +0100 Subject: [PATCH 04/19] Try fetching calendar --- .github/workflows/getcalendar.yml | 34 +++++++++++++++++++++++++++++++ calendar.sh | 7 +++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/getcalendar.yml create mode 100644 calendar.sh diff --git a/.github/workflows/getcalendar.yml b/.github/workflows/getcalendar.yml new file mode 100644 index 0000000..514ac06 --- /dev/null +++ b/.github/workflows/getcalendar.yml @@ -0,0 +1,34 @@ +name: Fetch the Google Calendar + +on: + workflow_dispatch: + # schedule: + # - cron: '01 18 * * *' + +permissions: + contents: write + +jobs: + fetch-calendar: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Curl calendar + run: | + cd static/js + echo "download calendar" + bash ../../getcalendar.sh + echo "preparing to push change(s)" + git add . + if git commit -m "Add updates" + then + git push + echo "Changed!" + exit 0 + else + echo "No change" + true # ensure success + fi + env: # for gh + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/calendar.sh b/calendar.sh new file mode 100644 index 0000000..1c7c2c2 --- /dev/null +++ b/calendar.sh @@ -0,0 +1,7 @@ +CALENDAR_ID="nerseigospses068jd57bk5ar8@group.calendar.google.com" +API_KEY="AIzaSyDJkXq1faq2G5NkFkFTh9Sikdpc2YXTVXs" +NOW=$(date '+%Y-%m-%dT%H:%M:%SZ') +OPTS="?key=${API_KEY}&timeMin=${NOW}&singleEvents=true&orderBy=startTime&timezone=UTC&maxResults=20" +curl -sS -o calendar.json "https://www.googleapis.com/calendar/v3/calendars/${CALENDAR_ID}/events${OPTS}" \ + -H 'accept: application/json, text/javascript, */*; q=0.01' \ + -H 'origin: https://events.apache.org' From 3f85aaee22b422d12f0620d9bab40e6b42054d6a Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 00:21:56 +0100 Subject: [PATCH 05/19] Update getcalendar.yml --- .github/workflows/getcalendar.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/getcalendar.yml b/.github/workflows/getcalendar.yml index 514ac06..bc5d819 100644 --- a/.github/workflows/getcalendar.yml +++ b/.github/workflows/getcalendar.yml @@ -2,6 +2,7 @@ name: Fetch the Google Calendar on: workflow_dispatch: + push: # schedule: # - cron: '01 18 * * *' From b6678379d1924e5944d2333fd832ae7f312b1751 Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 00:24:03 +0100 Subject: [PATCH 06/19] Renamed --- calendar.sh => getcalendar.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename calendar.sh => getcalendar.sh (100%) diff --git a/calendar.sh b/getcalendar.sh similarity index 100% rename from calendar.sh rename to getcalendar.sh From 08bd6e79900f56c1df2e8c683dd9d02a09ae4fa9 Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 00:27:19 +0100 Subject: [PATCH 07/19] Need a user id --- .github/workflows/getcalendar.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/getcalendar.yml b/.github/workflows/getcalendar.yml index bc5d819..4304fd8 100644 --- a/.github/workflows/getcalendar.yml +++ b/.github/workflows/getcalendar.yml @@ -17,6 +17,8 @@ jobs: - uses: actions/checkout@v4 - name: Curl calendar run: | + git config user.email "dev@community.apache.org" + git config user.name "Community Developers" cd static/js echo "download calendar" bash ../../getcalendar.sh From 74b8bcb576f8c4e21c55075241a9860400f8fa5c Mon Sep 17 00:00:00 2001 From: Community Developers Date: Thu, 18 Apr 2024 23:27:32 +0000 Subject: [PATCH 08/19] Add updates --- static/js/calendar.json | 507 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 507 insertions(+) create mode 100644 static/js/calendar.json diff --git a/static/js/calendar.json b/static/js/calendar.json new file mode 100644 index 0000000..53fc69f --- /dev/null +++ b/static/js/calendar.json @@ -0,0 +1,507 @@ +{ + "kind": "calendar#events", + "etag": "\"p324b1fsnin3oa0o\"", + "summary": "Apache Conferences & Events", + "description": "", + "updated": "2024-04-16T16:35:20.661Z", + "timeZone": "America/Los_Angeles", + "accessRole": "reader", + "defaultReminders": [], + "items": [ + { + "kind": "calendar#event", + "etag": "\"3396478494468000\"", + "id": "4durem2litvi92nrg78q1qmqbl", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=NGR1cmVtMmxpdHZpOTJucmc3OHExcW1xYmwgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2023-10-25T13:07:27.000Z", + "updated": "2023-10-25T13:07:27.234Z", + "summary": "Kafka Summit India 2024", + "description": "https://www.kafka-summit.org/events/kafka-summit-bangalore-2024/about", + "location": "Bengaluru", + "creator": { + "email": "rbowen@rcbowen.com", + "displayName": "Rich Bowen" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "date": "2024-05-02" + }, + "end": { + "date": "2024-05-03" + }, + "transparency": "transparent", + "iCalUID": "4durem2litvi92nrg78q1qmqbl@google.com", + "sequence": 0, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3426554200536000\"", + "id": "6scddpejutghvhl4be4g531nqb", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=NnNjZGRwZWp1dGdodmhsNGJlNGc1MzFucWIgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2024-04-16T14:18:20.000Z", + "updated": "2024-04-16T14:18:20.268Z", + "summary": "Traffic Server Spring Summit", + "description": "https://cwiki.apache.org/confluence/display/TS/Spring+2024+Summit", + "creator": { + "email": "rbowen@rcbowen.com", + "displayName": "Rich Bowen" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "date": "2024-05-07" + }, + "end": { + "date": "2024-05-10" + }, + "transparency": "transparent", + "iCalUID": "6scddpejutghvhl4be4g531nqb@google.com", + "sequence": 0, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3426570587942000\"", + "id": "3hbqcho107fkt5mhilkuahrnf2", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=M2hicWNobzEwN2ZrdDVtaGlsa3VhaHJuZjIgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2024-01-31T16:54:06.000Z", + "updated": "2024-04-16T16:34:53.971Z", + "summary": "Pulsar Summit - Virtual", + "location": "EMEA", + "creator": { + "email": "markt@gsuite.cloud.apache.org" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "dateTime": "2024-05-14T01:00:00-07:00", + "timeZone": "Europe/London" + }, + "end": { + "dateTime": "2024-05-14T10:00:00-07:00", + "timeZone": "Europe/London" + }, + "iCalUID": "3hbqcho107fkt5mhilkuahrnf2@google.com", + "sequence": 0, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3426570641322000\"", + "id": "02o4jak1i05a6dpbeoem9qrles", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=MDJvNGphazFpMDVhNmRwYmVvZW05cXJsZXMgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2024-02-24T12:10:11.000Z", + "updated": "2024-04-16T16:35:20.661Z", + "summary": "Iceberg Summit", + "description": "https://iceberg-summit.org/", + "location": "Virtual (North America Timezones)", + "creator": { + "email": "markt@gsuite.cloud.apache.org" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "dateTime": "2024-05-14T04:00:00-07:00", + "timeZone": "Europe/London" + }, + "end": { + "dateTime": "2024-05-15T04:30:00-07:00", + "timeZone": "Europe/London" + }, + "transparency": "transparent", + "iCalUID": "02o4jak1i05a6dpbeoem9qrles@google.com", + "sequence": 1, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3398906451784000\"", + "id": "12aekn53jb4qdi6u0gnii9cfeq", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=MTJhZWtuNTNqYjRxZGk2dTBnbmlpOWNmZXEgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2023-05-24T13:03:29.000Z", + "updated": "2023-11-08T14:20:25.892Z", + "summary": "Community Over Code EU, 2024", + "description": "https://eu.communityovercode.org", + "location": "EU", + "creator": { + "email": "rbowen@rcbowen.com", + "displayName": "Rich Bowen" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "date": "2024-06-03" + }, + "end": { + "date": "2024-06-06" + }, + "transparency": "transparent", + "iCalUID": "12aekn53jb4qdi6u0gnii9cfeq@google.com", + "sequence": 6, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3417552995234000\"", + "id": "5dolob0u7jcn86m3ui9lpkkri4", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=NWRvbG9iMHU3amNuODZtM3VpOWxwa2tyaTQgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2024-02-24T12:07:56.000Z", + "updated": "2024-02-24T12:08:17.617Z", + "summary": "NuttX International Workshop, 2024", + "description": "https://events.nuttx.apache.org/", + "location": "Tokyo, Japan", + "creator": { + "email": "markt@gsuite.cloud.apache.org" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "dateTime": "2024-06-13T04:00:00-07:00", + "timeZone": "Europe/London" + }, + "end": { + "dateTime": "2024-06-14T04:30:00-07:00", + "timeZone": "Europe/London" + }, + "transparency": "transparent", + "iCalUID": "5dolob0u7jcn86m3ui9lpkkri4@google.com", + "sequence": 1, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3412519600866000\"", + "id": "7eh7aclth37ajhu1vrondcae1v", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=N2VoN2FjbHRoMzdhamh1MXZyb25kY2FlMXYgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2024-01-26T09:02:47.000Z", + "updated": "2024-01-26T09:03:20.433Z", + "summary": "Community over Code Asia 2024", + "description": "https://asia.communityovercode.org/", + "location": "Hangzhou, Zhejiang, China", + "creator": { + "email": "markt@gsuite.cloud.apache.org" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "dateTime": "2024-07-26T02:00:00-07:00", + "timeZone": "Europe/London" + }, + "end": { + "dateTime": "2024-07-28T09:00:00-07:00", + "timeZone": "Europe/London" + }, + "iCalUID": "7eh7aclth37ajhu1vrondcae1v@google.com", + "sequence": 0, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3415501872938000\"", + "id": "1dv10v7ntte92ts2tun8ptk8lt", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=MWR2MTB2N250dGU5MnRzMnR1bjhwdGs4bHQgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2024-02-12T15:13:41.000Z", + "updated": "2024-02-12T15:15:36.469Z", + "summary": "Airflow Summit North America", + "description": "https://airflowsummit.org/", + "location": "San Francisco, CA, USA", + "creator": { + "email": "rbowen@rcbowen.com", + "displayName": "Rich Bowen" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "date": "2024-09-10" + }, + "end": { + "date": "2024-09-13" + }, + "transparency": "transparent", + "iCalUID": "1dv10v7ntte92ts2tun8ptk8lt@google.com", + "sequence": 0, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3370079705042000\"", + "id": "1d085fam4evsd2457772prg61i", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=MWQwODVmYW00ZXZzZDI0NTc3NzJwcmc2MWkgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2023-03-06T20:41:13.000Z", + "updated": "2023-05-25T18:37:32.521Z", + "summary": "Current 2024: The Next Generation of Kafka Summit", + "description": "https://www.kafka-summit.org/", + "location": "Austin, TX, USA", + "creator": { + "email": "rbowen@rcbowen.com", + "displayName": "Rich Bowen" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "dateTime": "2024-09-17T00:00:00-07:00", + "timeZone": "Europe/London" + }, + "end": { + "dateTime": "2024-09-18T10:00:00-07:00", + "timeZone": "Europe/London" + }, + "transparency": "transparent", + "iCalUID": "1d085fam4evsd2457772prg61i@google.com", + "sequence": 4, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3404846082702000\"", + "id": "1krl7eacdvuvf0rpt52jercjp1", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=MWtybDdlYWNkdnV2ZjBycHQ1MmplcmNqcDEgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2023-12-12T23:17:21.000Z", + "updated": "2023-12-12T23:17:21.351Z", + "summary": "Community Over Code", + "description": "https://communityovercode.org/", + "location": "Denver, CO, USA", + "creator": { + "email": "markt@gsuite.cloud.apache.org" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "dateTime": "2024-10-07T00:00:00-07:00", + "timeZone": "Europe/London" + }, + "end": { + "dateTime": "2024-10-10T10:00:00-07:00", + "timeZone": "Europe/London" + }, + "iCalUID": "1krl7eacdvuvf0rpt52jercjp1@google.com", + "sequence": 0, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3420716393690000\"", + "id": "71adshq9v1828gh6522pekvd3d", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=NzFhZHNocTl2MTgyOGdoNjUyMnBla3ZkM2QgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2023-08-29T20:43:19.000Z", + "updated": "2024-03-13T19:29:56.845Z", + "summary": "Flink Forward", + "description": "https://www.flink-forward.org/", + "location": "Berlin, Germany", + "creator": { + "email": "markt@gsuite.cloud.apache.org" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "dateTime": "2024-10-21T00:00:00-07:00", + "timeZone": "Europe/London" + }, + "end": { + "dateTime": "2024-10-24T10:00:00-07:00", + "timeZone": "Europe/London" + }, + "iCalUID": "71adshq9v1828gh6522pekvd3d@google.com", + "sequence": 1, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3413907496104000\"", + "id": "05sde01iuhd4mosanlkp66fl4p", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=MDVzZGUwMWl1aGQ0bW9zYW5sa3A2NmZsNHAgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2024-02-03T09:49:08.000Z", + "updated": "2024-02-03T09:49:08.052Z", + "summary": "Pulsar Summit", + "location": "North America", + "creator": { + "email": "markt@gsuite.cloud.apache.org" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "dateTime": "2024-10-29T02:00:00-07:00", + "timeZone": "Europe/London" + }, + "end": { + "dateTime": "2024-10-29T10:00:00-07:00", + "timeZone": "Europe/London" + }, + "iCalUID": "05sde01iuhd4mosanlkp66fl4p@google.com", + "sequence": 0, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3417552557716000\"", + "id": "06ts34fv1td30ai2qbsjtjvv8p", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=MDZ0czM0ZnYxdGQzMGFpMnFic2p0anZ2OHAgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2024-02-24T12:03:50.000Z", + "updated": "2024-02-24T12:04:38.858Z", + "summary": "Doris Summit", + "location": "Asia", + "creator": { + "email": "markt@gsuite.cloud.apache.org" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "dateTime": "2024-11-02T05:00:00-07:00", + "timeZone": "Europe/London" + }, + "end": { + "dateTime": "2024-11-02T05:30:00-07:00", + "timeZone": "Europe/London" + }, + "transparency": "transparent", + "iCalUID": "06ts34fv1td30ai2qbsjtjvv8p@google.com", + "sequence": 1, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3413440274890000\"", + "id": "5b9ueenge6sag6ds71k0ovni8e", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=NWI5dWVlbmdlNnNhZzZkczcxazBvdm5pOGUgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2024-01-31T16:55:37.000Z", + "updated": "2024-01-31T16:55:37.445Z", + "summary": "Pulsar Summit", + "location": "APAC", + "creator": { + "email": "markt@gsuite.cloud.apache.org" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "dateTime": "2024-11-22T01:00:00-08:00", + "timeZone": "Europe/London" + }, + "end": { + "dateTime": "2024-11-22T10:00:00-08:00", + "timeZone": "Europe/London" + }, + "iCalUID": "5b9ueenge6sag6ds71k0ovni8e@google.com", + "sequence": 0, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3407564158026000\"", + "id": "65hl4m75r9sok5geau3lctel8t", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=NjVobDRtNzVyOXNvazVnZWF1M2xjdGVsOHQgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2023-12-28T16:47:16.000Z", + "updated": "2023-12-28T16:47:59.013Z", + "summary": "Flink Forward Asia 2024", + "location": "Shanghai, China and Singapore", + "creator": { + "email": "markt@gsuite.cloud.apache.org" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "dateTime": "2024-12-06T02:00:00-08:00", + "timeZone": "Europe/London" + }, + "end": { + "dateTime": "2024-12-08T10:00:00-08:00", + "timeZone": "Europe/London" + }, + "transparency": "transparent", + "iCalUID": "65hl4m75r9sok5geau3lctel8t@google.com", + "sequence": 1, + "eventType": "default" + }, + { + "kind": "calendar#event", + "etag": "\"3386683847594000\"", + "id": "2nshbfi1vd0kk0gmf019r007rl", + "status": "confirmed", + "htmlLink": "https://www.google.com/calendar/event?eid=Mm5zaGJmaTF2ZDBrazBnbWYwMTlyMDA3cmwgbmVyc2VpZ29zcHNlczA2OGpkNTdiazVhcjhAZw", + "created": "2023-08-29T20:45:23.000Z", + "updated": "2023-08-29T20:45:23.797Z", + "summary": "Flink Forward", + "location": "United States", + "creator": { + "email": "markt@gsuite.cloud.apache.org" + }, + "organizer": { + "email": "nerseigospses068jd57bk5ar8@group.calendar.google.com", + "displayName": "Apache Conferences & Events", + "self": true + }, + "start": { + "dateTime": "2025-10-07T00:00:00-07:00", + "timeZone": "Europe/London" + }, + "end": { + "dateTime": "2025-10-10T10:00:00-07:00", + "timeZone": "Europe/London" + }, + "iCalUID": "2nshbfi1vd0kk0gmf019r007rl@google.com", + "sequence": 0, + "eventType": "default" + } + ] +} From 29e316e0c29023e42a58f09b9d34eb5f0bba5da3 Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 00:37:13 +0100 Subject: [PATCH 09/19] Docco --- getcalendar.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/getcalendar.sh b/getcalendar.sh index 1c7c2c2..260b853 100644 --- a/getcalendar.sh +++ b/getcalendar.sh @@ -1,7 +1,12 @@ +#!/usr/bin/env bash + +# Fetch calendar data; will be stored as calendar.json + CALENDAR_ID="nerseigospses068jd57bk5ar8@group.calendar.google.com" API_KEY="AIzaSyDJkXq1faq2G5NkFkFTh9Sikdpc2YXTVXs" NOW=$(date '+%Y-%m-%dT%H:%M:%SZ') OPTS="?key=${API_KEY}&timeMin=${NOW}&singleEvents=true&orderBy=startTime&timezone=UTC&maxResults=20" + curl -sS -o calendar.json "https://www.googleapis.com/calendar/v3/calendars/${CALENDAR_ID}/events${OPTS}" \ -H 'accept: application/json, text/javascript, */*; q=0.01' \ -H 'origin: https://events.apache.org' From c25cd3736df27d109d4b8b475fac6fc9e798a0e1 Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 00:38:40 +0100 Subject: [PATCH 10/19] USe local data --- static/js/events-calendar.js | 125 ++++++++++++++++------------------- 1 file changed, 56 insertions(+), 69 deletions(-) diff --git a/static/js/events-calendar.js b/static/js/events-calendar.js index fa5ad42..abd33ed 100644 --- a/static/js/events-calendar.js +++ b/static/js/events-calendar.js @@ -1,13 +1,4 @@ -// This uses the Google Calendar v3 API to fetch details of the -// events held in the shared Apache events calendar -// That calendar is available to any Apache member who asks, the ID -// of it is : nerseigospses068jd57bk5ar8@group.calendar.google.com -var CALENDAR_ID = "nerseigospses068jd57bk5ar8@group.calendar.google.com"; -// Google Calendar API key, valid for *.apache.org and localhost -var API_KEY = "AIzaSyDJkXq1faq2G5NkFkFTh9Sikdpc2YXTVXs"; - -// We only need read-only access for our needs -var SCOPES = ['https://www.googleapis.com/auth/calendar.readonly']; +// Update the calendar page from the json file // Where to put things var events = $('#events'); @@ -15,70 +6,66 @@ if (!events) { events = $('body').append("
    "); } -// Options -var now = (new Date()).toISOString(); -var opts = "?key=" + API_KEY - + "&timeMin=" + now - + "&singleEvents=true" - + "&orderBy=startTime" - + "&timezone=America/New_York" - + "&maxResults=20"; +function apply(response) { + events.empty(); + + var el = response['items']; + let reg = /T.*$/; + let official = /(ApacheCon|Roadshow|Community (O|o)ver Code)/; + if (el.length > 0) { + for (i = 0; i < el.length; i++) { + var ev = el[i]; + var when = ev.start.dateTime; + if (!when) { + when = ev.start.date; + } + when = when.replace(reg,""); + if (ev.end) { + var end = ev.end.dateTime; + if (!end) { + end = ev.end.date; + } + end = end.replace(reg,""); + if (end != when) { + when = when + " to " + end; + } + } + var link = null; + if (ev.description) { + var line1 = ev.description.split("\n")[0]; + if (line1.slice(0,7) === "http://" || + line1.slice(0,8) === "https://" + ) { + link = line1.trim(); + } + } + + var html = "
  • "; + if (link) { html += ""; } + if (ev.summary.match(official)) { + html += "" + ev.summary + ""; + } else { + html += ev.summary; + } + if (link) { html += ""; } + html += " - " + when + ""; + if (ev.location) { + html += "
    "+ev.location; + } + events.append(html); + } + } else { + events.append("
  • No events found, sorry
  • "); + } +} + // Fetch $.ajax({ type: 'GET', - url: encodeURI('https://www.googleapis.com/calendar/v3/calendars/' + CALENDAR_ID + '/events' + opts), + url: encodeURI('/js/calendar.json'), dataType: 'json', success: function (response) { - events.empty(); - - var el = response['items']; - let reg = /T.*$/; - let official = /(ApacheCon|Roadshow|Community (O|o)ver Code)/; - if (el.length > 0) { - for (i = 0; i < el.length; i++) { - var ev = el[i]; - var when = ev.start.dateTime; - if (!when) { - when = ev.start.date; - } - when = when.replace(reg,""); - if (ev.end) { - var end = ev.end.dateTime; - if (!end) { - end = ev.end.date; - } - end = end.replace(reg,""); - if (end != when) { - when = when + " to " + end; - } - } - var link = null; - if (ev.description) { - var line1 = ev.description.split("\n")[0]; - if (line1.slice(0,7) === "http://" || - line1.slice(0,8) === "https://" - ) { - link = line1.trim(); - } - } - - var html = "
  • "; - if (link) { html += ""; } - if (ev.summary.match(official)) { - html += "" + ev.summary + ""; - } else { - html += ev.summary; - } - if (link) { html += ""; } - html += " - " + when + ""; - if (ev.location) { - html += "
    "+ev.location; - } - events.append(html); - } - } else { - events.append("
  • No events found, sorry
  • "); - } + apply(response); }, error: function (response) { events.empty(); From fad04b6a1f8df8c1232fd98a94e29de83f5851dd Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 00:41:13 +0100 Subject: [PATCH 11/19] Run daily --- .github/workflows/getcalendar.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/getcalendar.yml b/.github/workflows/getcalendar.yml index 4304fd8..9956a04 100644 --- a/.github/workflows/getcalendar.yml +++ b/.github/workflows/getcalendar.yml @@ -2,9 +2,8 @@ name: Fetch the Google Calendar on: workflow_dispatch: - push: - # schedule: - # - cron: '01 18 * * *' + schedule: + - cron: '10 10 * * *' permissions: contents: write From d32f011232c8e9e4a537a2b08d1a8507b308825c Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 09:16:14 +0100 Subject: [PATCH 12/19] Dummy change to check it forces a build Should be reverted by GHA cronjob --- static/js/calendar.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/calendar.json b/static/js/calendar.json index 53fc69f..e16ae02 100644 --- a/static/js/calendar.json +++ b/static/js/calendar.json @@ -2,7 +2,7 @@ "kind": "calendar#events", "etag": "\"p324b1fsnin3oa0o\"", "summary": "Apache Conferences & Events", - "description": "", + "description": "TBA", "updated": "2024-04-16T16:35:20.661Z", "timeZone": "America/Los_Angeles", "accessRole": "reader", From 2fced833d0653187c323a83e2485d9d6ef06c6a6 Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 09:27:18 +0100 Subject: [PATCH 13/19] Show status --- .github/workflows/getcalendar.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/getcalendar.yml b/.github/workflows/getcalendar.yml index 9956a04..18059df 100644 --- a/.github/workflows/getcalendar.yml +++ b/.github/workflows/getcalendar.yml @@ -21,6 +21,7 @@ jobs: cd static/js echo "download calendar" bash ../../getcalendar.sh + git status echo "preparing to push change(s)" git add . if git commit -m "Add updates" From 144841d7013f3c98773e22cfe8c451e2da1590d3 Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 09:33:38 +0100 Subject: [PATCH 14/19] Update getcalendar.sh --- getcalendar.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/getcalendar.sh b/getcalendar.sh index 260b853..b337768 100644 --- a/getcalendar.sh +++ b/getcalendar.sh @@ -7,6 +7,12 @@ API_KEY="AIzaSyDJkXq1faq2G5NkFkFTh9Sikdpc2YXTVXs" NOW=$(date '+%Y-%m-%dT%H:%M:%SZ') OPTS="?key=${API_KEY}&timeMin=${NOW}&singleEvents=true&orderBy=startTime&timezone=UTC&maxResults=20" +echo "Fetching calendar data" +ls -l calendar.json + curl -sS -o calendar.json "https://www.googleapis.com/calendar/v3/calendars/${CALENDAR_ID}/events${OPTS}" \ -H 'accept: application/json, text/javascript, */*; q=0.01' \ -H 'origin: https://events.apache.org' + +echo "Fetched data" +ls -l calendar.json From eafb074f72fb6c869f514db0c94d3783ef20cd9e Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 10:47:06 +0100 Subject: [PATCH 15/19] Bring schedule forward --- .github/workflows/getcalendar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/getcalendar.yml b/.github/workflows/getcalendar.yml index 18059df..0e806c4 100644 --- a/.github/workflows/getcalendar.yml +++ b/.github/workflows/getcalendar.yml @@ -3,7 +3,7 @@ name: Fetch the Google Calendar on: workflow_dispatch: schedule: - - cron: '10 10 * * *' + - cron: '50 9 * * *' permissions: contents: write From f525fce901fc56f482f5615b7189ed07ed042489 Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 10:52:47 +0100 Subject: [PATCH 16/19] Need to push on a non-default branch --- .github/workflows/getcalendar.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/getcalendar.yml b/.github/workflows/getcalendar.yml index 0e806c4..6348219 100644 --- a/.github/workflows/getcalendar.yml +++ b/.github/workflows/getcalendar.yml @@ -1,8 +1,9 @@ name: Fetch the Google Calendar on: - workflow_dispatch: - schedule: + workflow_dispatch: # only works in default branch + push: + schedule: # only works in default branch - cron: '50 9 * * *' permissions: From e2986f41bff7652c1372068ecc10e41a402509f6 Mon Sep 17 00:00:00 2001 From: Community Developers Date: Fri, 19 Apr 2024 09:53:01 +0000 Subject: [PATCH 17/19] Add updates --- static/js/calendar.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/calendar.json b/static/js/calendar.json index e16ae02..53fc69f 100644 --- a/static/js/calendar.json +++ b/static/js/calendar.json @@ -2,7 +2,7 @@ "kind": "calendar#events", "etag": "\"p324b1fsnin3oa0o\"", "summary": "Apache Conferences & Events", - "description": "TBA", + "description": "", "updated": "2024-04-16T16:35:20.661Z", "timeZone": "America/Los_Angeles", "accessRole": "reader", From 8ed607a355dba92bbc58bda2d0540f040c9a83e3 Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 11:01:25 +0100 Subject: [PATCH 18/19] Drop debug --- getcalendar.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/getcalendar.sh b/getcalendar.sh index b337768..5ae92a0 100644 --- a/getcalendar.sh +++ b/getcalendar.sh @@ -8,11 +8,9 @@ NOW=$(date '+%Y-%m-%dT%H:%M:%SZ') OPTS="?key=${API_KEY}&timeMin=${NOW}&singleEvents=true&orderBy=startTime&timezone=UTC&maxResults=20" echo "Fetching calendar data" -ls -l calendar.json curl -sS -o calendar.json "https://www.googleapis.com/calendar/v3/calendars/${CALENDAR_ID}/events${OPTS}" \ -H 'accept: application/json, text/javascript, */*; q=0.01' \ -H 'origin: https://events.apache.org' echo "Fetched data" -ls -l calendar.json From 95955def28ec2f295bb6662682954e870c062f6f Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 19 Apr 2024 15:24:38 +0100 Subject: [PATCH 19/19] Reduce the number of changes from main --- static/js/events-calendar.js | 104 +++++++++++++++++------------------ 1 file changed, 50 insertions(+), 54 deletions(-) diff --git a/static/js/events-calendar.js b/static/js/events-calendar.js index abd33ed..f5e2543 100644 --- a/static/js/events-calendar.js +++ b/static/js/events-calendar.js @@ -6,66 +6,62 @@ if (!events) { events = $('body').append("
      "); } -function apply(response) { - events.empty(); - - var el = response['items']; - let reg = /T.*$/; - let official = /(ApacheCon|Roadshow|Community (O|o)ver Code)/; - if (el.length > 0) { - for (i = 0; i < el.length; i++) { - var ev = el[i]; - var when = ev.start.dateTime; - if (!when) { - when = ev.start.date; - } - when = when.replace(reg,""); - if (ev.end) { - var end = ev.end.dateTime; - if (!end) { - end = ev.end.date; - } - end = end.replace(reg,""); - if (end != when) { - when = when + " to " + end; - } - } - var link = null; - if (ev.description) { - var line1 = ev.description.split("\n")[0]; - if (line1.slice(0,7) === "http://" || - line1.slice(0,8) === "https://" - ) { - link = line1.trim(); - } - } - - var html = "
    • "; - if (link) { html += ""; } - if (ev.summary.match(official)) { - html += "" + ev.summary + ""; - } else { - html += ev.summary; - } - if (link) { html += ""; } - html += " - " + when + ""; - if (ev.location) { - html += "
      "+ev.location; - } - events.append(html); - } - } else { - events.append("
    • No events found, sorry
    • "); - } -} - // Fetch $.ajax({ type: 'GET', url: encodeURI('/js/calendar.json'), dataType: 'json', success: function (response) { - apply(response); + events.empty(); + + var el = response['items']; + let reg = /T.*$/; + let official = /(ApacheCon|Roadshow|Community (O|o)ver Code)/; + if (el.length > 0) { + for (i = 0; i < el.length; i++) { + var ev = el[i]; + var when = ev.start.dateTime; + if (!when) { + when = ev.start.date; + } + when = when.replace(reg,""); + if (ev.end) { + var end = ev.end.dateTime; + if (!end) { + end = ev.end.date; + } + end = end.replace(reg,""); + if (end != when) { + when = when + " to " + end; + } + } + var link = null; + if (ev.description) { + var line1 = ev.description.split("\n")[0]; + if (line1.slice(0,7) === "http://" || + line1.slice(0,8) === "https://" + ) { + link = line1.trim(); + } + } + + var html = "
    • "; + if (link) { html += ""; } + if (ev.summary.match(official)) { + html += "" + ev.summary + ""; + } else { + html += ev.summary; + } + if (link) { html += ""; } + html += " - " + when + ""; + if (ev.location) { + html += "
      "+ev.location; + } + events.append(html); + } + } else { + events.append("
    • No events found, sorry
    • "); + } }, error: function (response) { events.empty();