From 3f48399c0910a6806821510d8a9ecfd13c86bac2 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sun, 22 Sep 2024 09:05:43 -0700 Subject: [PATCH] chore: better function name --- package-lock.json | 10 +++++----- package.json | 2 +- workers/mastodon/index.js | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4247b4fc..5e6fb046 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "24.19.4", + "version": "24.19.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "24.19.4", + "version": "24.19.5", "license": "MIT", "dependencies": { "@cdransf/api-text": "^1.5.0", @@ -2759,9 +2759,9 @@ } }, "node_modules/liquidjs": { - "version": "10.16.7", - "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-10.16.7.tgz", - "integrity": "sha512-vjlBDyPxFgUc6vJB+TbAMcxKKKcm4Ee0rj9Je9lcG1I0lr9xvtHgB/ZdNMNAgsPUvJLkLfdrKRd+KzQ5opPfNg==", + "version": "10.17.0", + "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-10.17.0.tgz", + "integrity": "sha512-M4MC5/nencttIJHirl5jFTkl7Yu+grIDLn3Qgl7BPAD3BsbTCQknDxlG5VXWRwslWIjk8lSZZjVq9LioILDk1Q==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index f6893212..36218584 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "24.19.4", + "version": "24.19.5", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "scripts": { diff --git a/workers/mastodon/index.js b/workers/mastodon/index.js index 9bd10a0e..eda8b993 100644 --- a/workers/mastodon/index.js +++ b/workers/mastodon/index.js @@ -3,20 +3,20 @@ import { convert } from 'html-to-text' export default { async scheduled(event, env, ctx) { - await handleScheduledEvent(env) + await handleMastodonPost(env) }, async fetch(request, env, ctx) { if (request.method !== 'POST') return new Response('Method Not Allowed', { status: 405 }) if (request.headers.get('x-webhook-token') !== env.WEBHOOK_SECRET) return new Response('Unauthorized', { status: 401 }) - await handleScheduledEvent(env) + await handleMastodonPost(env) return new Response('Worker triggered by successful build.', { status: 200 }) } } -async function handleScheduledEvent(env) { +async function handleMastodonPost(env) { const mastodonApiUrl = 'https://social.lol/api/v1/statuses' const accessToken = env.MASTODON_ACCESS_TOKEN const rssFeedUrl = 'https://coryd.dev/feeds/all'