Improve formatting
This commit is contained in:
@ -22,24 +22,26 @@ export function createFeed(posts: Post[]): Feed {
|
||||
author: {
|
||||
name: '@aymm',
|
||||
link: 'https://metalhead.club/@aymm'
|
||||
},
|
||||
}
|
||||
});
|
||||
posts.forEach(p => {
|
||||
posts.forEach((p) => {
|
||||
feed.addItem({
|
||||
title: p.content,
|
||||
id: p.url,
|
||||
link: p.url,
|
||||
content: p.content,
|
||||
author: [{
|
||||
name: p.account.acct,
|
||||
link: p.account.url
|
||||
}],
|
||||
author: [
|
||||
{
|
||||
name: p.account.acct,
|
||||
link: p.account.url
|
||||
}
|
||||
],
|
||||
date: new Date(p.created_at)
|
||||
})
|
||||
});
|
||||
});
|
||||
feed.addCategory('Music');
|
||||
return feed;
|
||||
}
|
||||
export async function saveAtomFeed(feed: Feed) {
|
||||
await fs.writeFile('feed.xml', feed.atom1(), { encoding: 'utf8' });
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user