diff options
| author | Fuwn <[email protected]> | 2023-09-17 23:41:11 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-17 23:41:11 -0700 |
| commit | 715b2f07fbfd781df667866aff0b3ce7ae36fa1d (patch) | |
| tree | 5ecff53837a8d03928e90ad6a00e5dcc441cafb5 /src | |
| parent | fix(notifications): rss standards (diff) | |
| download | due.moe-715b2f07fbfd781df667866aff0b3ce7ae36fa1d.tar.xz due.moe-715b2f07fbfd781df667866aff0b3ce7ae36fa1d.zip | |
feat(notifications): better image support
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/feeds/activity-notifications/+server.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/routes/feeds/activity-notifications/+server.ts b/src/routes/feeds/activity-notifications/+server.ts index db283613..e57e9d55 100644 --- a/src/routes/feeds/activity-notifications/+server.ts +++ b/src/routes/feeds/activity-notifications/+server.ts @@ -3,7 +3,12 @@ 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[]) => `<?xml version="1.0" encoding="UTF-8" ?> -<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> +<rss + version="2.0" + xmlns:atom="http://www.w3.org/2005/Atom" + xmlns:content="http://purl.org/rss/1.0/modules/content/" + xmlns:snf="http://www.smartnews.be/snf" + xmlns:media="http://search.yahoo.com/mrss/"> <channel> <atom:link href="https://due.moe/feeds/activity-notifications" rel="self" type="application/rss+xml" /> <title>期限 | AniList Notifications</title> @@ -12,11 +17,7 @@ export const GET = async ({ url }) => { <pubDate>${new Date().toUTCString()}</pubDate> <lastBuildDate>${new Date().toUTCString()}</lastBuildDate> <language>en-US</language> - <image> - <url>https://due.moe/favicon-192x192.png</url> - <link>https://due.moe</link> - <title>期限 | AniList Notifications</title> - </image> + <snf:logo><url>https://due.moe/favicon-192x192.png</url></snf:logo> ${posts .map((notification: Notification) => { let title = `${notification.user.name} ${notification.context}`; @@ -44,7 +45,7 @@ export const GET = async ({ url }) => { <title>${title}</title> <link>${link}</link> <author>${notification.user.name}</author> -<enclosure url="${notification.user.avatar.large}" type="image/png" /> +<media:thumbnail url="${notification.user.avatar.large}" /> <category>${prettyType}</category> <pubDate>${new Date( notification.createdAt * 1000 + new Date().getTimezoneOffset() |