Last active
May 15, 2022 15:25
-
-
Save kamimi01/1e9afca5989750454b7b65842d2a50d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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