From d3fcc2d587bd9c1e5a405518c7b53f2461bb8221 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 17 Sep 2023 20:00:24 -0700 Subject: refactor(feeds): rename notifications --- src/routes/feeds/notifications/+server.ts | 58 ------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 src/routes/feeds/notifications/+server.ts diff --git a/src/routes/feeds/notifications/+server.ts b/src/routes/feeds/notifications/+server.ts deleted file mode 100644 index b06aa1f3..00000000 --- a/src/routes/feeds/notifications/+server.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { notifications, type Notification } from '$lib/AniList/notifications'; - -export const GET = async ({ url }) => { - const data = await notifications(url.searchParams.get('token') || 'null'); - const render = (posts: Notification[]) => ` - - - - 期限 | AniList Notifications - https://due.moe - Instantly view your AniList notifications via RSS! - ${new Date().toUTCString()} - ${new Date().toUTCString()} - en-US - - https://due.moe/favicon-192x192.png - https://due.moe - 期限 Logo - - ${posts - .map((notification: Notification) => { - let title = `${notification.user.name} ${notification.context}`; - const prettyType = notification.type - .toString() - .replace(/_/g, ' ') - .toLowerCase() - .replace(/\w\S*/g, (text) => { - return text.charAt(0).toUpperCase() + text.substr(1).toLowerCase(); - }); - - if (notification.type.toString().includes('THREAD')) { - title += `${notification.thread.title}`; - } - - return ` -${notification.id} -${title} -https://anilist.co/user/${notification.user.name} -${notification.user.name} - -${prettyType} -${new Date( - notification.createdAt * 1000 + new Date().getTimezoneOffset() - ).toUTCString()} -`; - }) - .join('')} - - -`; - - return new Response(render(data), { - headers: { - 'Cache-Control': `max-age=0, s-max-age=${600}`, - 'Content-Type': 'application/xml' - } - }); -}; -- cgit v1.2.3