Skip to content

Cloudflare Workers to subscribe Google Calendar changes for LINE bot.

Notifications You must be signed in to change notification settings

mrskiro/lavendar

Repository files navigation

Lavendar

Lavendar illustration

Notify LINE bot of google calendar changes.

Getting Started

yarn install
cp wrangler.toml.example wrangler.toml
cp .dev.vars.example .dev.vars

Add your wrangler infomation to wrangler.toml, And token and secrets to .dev.vars

Testing Cron

yarn dev:cron
// Ready on http://localhost:xxxxx
curl "http://localhost:xxxxx/__scheduled?cron=*+*+*+*+*"

Execute SQL

npx wrangler d1 execute your-db --local --command="SELECT * FROM calendars"

Secrets

GOOGLE_CREDENTIALS

  1. From here, issue a service account key and download the json file.
  2. Run cat <your>.json | base64 and copy and paste the output values into .dev.vars

Escape hatch

If extra notification channels are added during debugging, you can remove them below.

curl -X DELETE \
  -H "Content-Type: application/json" \
  -d '{
    "id": "xxx",
    "resourceId": "xxx"
  }' \
  https://your-api/calendars/channel

TODO

  • testing
  • linter & formatter
  • CICD

About

Cloudflare Workers to subscribe Google Calendar changes for LINE bot.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published