From 83568a77dc46f5f647080fde91f2108eef8599ad Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Wed, 14 Aug 2024 10:25:37 -0700 Subject: [PATCH] fix: quick change --- package-lock.json | 4 ++-- package.json | 2 +- workers/analytics/index.js | 40 -------------------------------------- 3 files changed, 3 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index e72ee730..256878a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "22.3.0", + "version": "22.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "22.3.0", + "version": "22.3.1", "license": "MIT", "dependencies": { "@cdransf/api-text": "^1.5.0", diff --git a/package.json b/package.json index 9c14acee..a9779d45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "22.3.0", + "version": "22.3.1", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "scripts": { diff --git a/workers/analytics/index.js b/workers/analytics/index.js index 54e8587e..563aad92 100644 --- a/workers/analytics/index.js +++ b/workers/analytics/index.js @@ -5,46 +5,6 @@ addEventListener('fetch', event => { async function handleRequest(request) { const url = new URL(request.url) - if (url.pathname.startsWith('/feeds/')) { - const response = await fetch(request) - const rssFeed = await response.text() - const UMAMI_API_KEY = env.UMAMI_API_KEY - const feedName = url.pathname.split('/feeds/')[1] || 'unknown' - const userAgent = request.headers.get('User-Agent') || 'unknown' - const analyticsPayload = { - type: 'event', - payload: { - website: UMAMI_API_KEY, - hostname: url.hostname, - url: url.pathname, - referrer: request.headers.get('Referer') || '', - language: request.headers.get('Accept-Language') || '', - title: 'RSS Feed Access', - name: 'rss_feed_view', - data: { - feed: feedName, - userAgent: userAgent - } - } - } - - await fetch('https://dashboard.coryd.dev/api/collect', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'Authorization': `Bearer ${UMAMI_API_KEY}` - }, - body: JSON.stringify(analyticsPayload) - }) - - return new Response(rssFeed, { - status: 200, - headers: { - 'Content-Type': 'application/rss+xml' - } - }) - } - if (url.pathname === '/js/script.js') { const targetUrl = 'https://dashboard.coryd.dev/script.js' const response = await fetch(targetUrl, {