mrskiro / lavendar

Cloudflare Workers to subscribe Google Calendar changes for LINE bot.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.


Languages

Language:TypeScript 100.0%