gcal-sync synchronizes Google Calendar events to another calendar (also in another account) via Google Calendar API.
You can set simple rules to adjust time of creating event.
- Create an event on business calendar to block the time box when an event is created on private calendar.
It bothers me to create an event on calendar for business just for blocking the time box when I create an event on calendar on private. You can do this by using like Zapier if you want to sync ALL new events to another account. But for example, it is difficult & bothered to set complicated rules on Zapier. Plus, executing such task needs paid plan!
- Go
- Google Cloud services
- App Engine
- Firestore
- Cloud Scheduler
You must register the domain for Push notification channel URL of Google Calendar. Set static/googlexxx.html file for registration.
See also Registering your domain
https://console.cloud.google.com/apis/library/calendar-json.googleapis.com
For accessing to Firestore, needs service account key with Firebase Admin SDK role.
- env.yaml: sample is sample.env.yaml
- .env: sample is .sample.env
- app.yaml: sample is sample.app.yaml
make deploy
make schedule
go run cmd/watch/watch.go
For some reason, you may want to stop some channels:
go run cmd/stop/stop.go channel-id resource-id
For accessing Google Calendar API, you can use oauth client instead of service account.
Needs
- OAuth consent screen
- scope:
https://www.googleapis.com/auth/calendar.events.owned
- scope:
- OAuth client secret
go run cmd/token/token.go src # for getting token of source calendar
go run cmd/token/token.go dest # for destination calendar