updated to differentiate between generic and special feeds

This commit is contained in:
dylan 2025-12-28 17:32:17 +00:00
parent df031eaa4a
commit acdb9ff8d7

View file

@ -78,7 +78,13 @@ export default async function now() {
.replace('{instance}', item.instance || '')
}
const latest = await handler(feedUrl || { ...item, feedUrl })
// generic handlers expect just feedUrl string, special handlers expect config object
const handlerParam = ['rss', 'atom', 'json', 'mastodon', 'maloja'].includes(
item.feedType,
)
? feedUrl
: { ...item, feedUrl }
const latest = await handler(handlerParam)
console.log(`${item.id}: ${latest.text}`)
console.log(`${item.id} URL: ${latest.url}`)