Export a google calendar to a ical ics file.
- Create a new google app and add the following scopes:
https://www.googleapis.com/auth/calendar.readonly https://www.googleapis.com/auth/calendar.events.readonly
- Create a oauth 2.0 client id and save the client_id & client_secret
gcal-to-ics export --client_id=google_client_id \
--client_secret=google_client_secret \
--account=name@gmail.com \
--calendar="my calendar" \
--output=out.ics
- Create a
config.yml
my-first-calendar: account_email: name@gmail.com calendar_name: my calendar formats: - ics overwrite_fields: visibility: public hide_fields: organizer: true attendees: true conference: true my-second-calendar: account_email: name@gmail.com calendar_name: my calendar formats: - ics overwrite_fields: visibility: public hide_fields: organizer: true attendees: true conference: true
- Create a
tokens
dir (this is where the tokens will be stored) - Setup your environment:
export CLIENT_ID="google client id" export CLIENT_SECRET="google client secret" export CONFIG_FILE="config.yml" export BIND_ADDR=":8080" export PUBLIC_URI="http://localhost:8080" export TOKEN_DIR="tokens" export CRYPT_SECRET="A secret for encrpyting the tokens"
- Run the application with the serve subcommand:
gcal-to-ics serve
- Navigate to
http://localhost:8080/my-first-calendar.ics
Code is not good but does what it should.