graph LR;
A[Schedule Event] --> B[Sync LeetCode Coding Challenge];
B --> C{Fetch Daily Coding Challenge};
C -->|Success| D[Create Todoist Task];
C -->|Failure| E[Handle Error];
D --> F[Task Created];
E --> G[Error Handling];
A Cloudflare Worker project that syncs Daily LeetCoding Challenge to your Todoist. The worker runs every day at 00:01 UTC and syncs the Daily LeetCoding Challenge to your Todoist.
- A Cloudflare account
- Install Wrangler CLI for Cloudflare Workers deployment
The dependencies are only used for development. So the installation is not required.
npm ci
To test out the cron trigger locally, run the following:
# 1. set TODOIST_API_TOKEN
wrangler login
wrangler secret put TODOIST_API_TOKEN
# 2. run worker
npm run dev # wrangler dev --test-scheduled --remote
# 3. test scheduled event.
curl "http://localhost:8787/__scheduled"
# 4. check if a new task is created on your Todoist
-
Add
TODOIST_API_TOKEN
usingwrangler secret put TODOIST_API_TOKEN
. You may find the newly added secret underCloudflare Worker
->Settings
->Variables
. You can get your Todoist API token from https://app.todoist.com/app/settings/integrations/developer. -
This is only required for Wrangler actions. Add
CF_API_TOKEN
into your GitHub repository secrets. You can create your API token from https://dash.cloudflare.com/profile/api-tokens using theEdit Cloudflare Workers
template. -
To publish any new changes to your Cloudflare Worker, run
wrangler deploy
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
- Fork this
- Create your feature branch (
git checkout -b tommy/fooBar
) - Commit your changes (
git commit -am 'feat: add some fooBar'
, make sure that your commits are semantic) - Push to the branch (
git push origin tommy/fooBar
) - Create a new Pull Request
Yes.