Skip to content

Instantly share code, notes, and snippets.

@kamimi01
Last active May 15, 2022 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamimi01/1e9afca5989750454b7b65842d2a50d5 to your computer and use it in GitHub Desktop.
Save kamimi01/1e9afca5989750454b7b65842d2a50d5 to your computer and use it in GitHub Desktop.
import Parser from 'rss-parser';
type CustomItem = {description: string}; // 追加
const parser: Parser<CustomItem> = new Parser({  // 修正
customFields: {
item: ['description']
}
});
(async () => {
const feed = await parser.parseURL('https://note.com/kamimi01/rss');
console.log(feed.title);
feed.items.forEach(item => {
console.log(item.title);
console.log(item.link);
console.log(item.description);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment