Skip to content

Commit

Permalink
Add crons
Browse files Browse the repository at this point in the history
  • Loading branch information
juanegiraldoa committed Apr 15, 2024
1 parent 13cb33b commit 9b15eb5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 0 additions & 8 deletions index.mjs

This file was deleted.

5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ export default {
const media_ids: string = env.MASTODON_WEDNESDAY_DUDE_MEDIA;
return new Response(await postOnWednesday(token, media_ids));
},
async scheduled(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
const token: string = env.MASTODON_TOKEN;
const media_ids: string = env.MASTODON_WEDNESDAY_DUDE_MEDIA;
return new Response(await postOnWednesday(token, media_ids));
},
};
3 changes: 3 additions & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ compatibility_flags = ["nodejs_compat"]
[vars]
MASTODON_TOKEN = "J_DPBhWeklP_RNirnbtFH-SIFYJtwv9CJ8Bjyog_xrY"
MASTODON_WEDNESDAY_DUDE_MEDIA = "112271920451061861"

[triggers]
crons = [ "0 8 * * wed" ]

0 comments on commit 9b15eb5

Please sign in to comment.