chore: feed updates

This commit is contained in:
Cory Dransfeldt 2023-09-08 09:00:04 -07:00
parent 70caf3eb21
commit d76c9f7351
No known key found for this signature in database
5 changed files with 29 additions and 6 deletions

View file

@ -12,14 +12,21 @@ module.exports = async function () {
const feed = await res
const articles = feed.feed
return articles.reverse().map((article) => {
const tags = article['content']['tags'].map((tag) => tag['name'])
const shareTags = tags
.map((tag) => `#${tag}`)
.join(' ')
.trim()
return {
url: article['content']['url'],
title: article['content']['title'],
date: article['content']['publication_date']
? new Date(article['content']['publication_date'])
: new Date(article['content']['feed_date']),
summary: article['content']['excerpt'],
date: article['content']['library']['modified_date']
? new Date(article['content']['library']['modified_date'])
: new Date(article['content']['publication_date']),
description: article['content']['excerpt'],
notes: article['content']['my_notes'],
tags,
shareTags,
id: btoa(article['id']),
}
})