We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a08135a commit 4ed4a18Copy full SHA for 4ed4a18
blocks/parse-rss/index.js
@@ -0,0 +1,23 @@
1
+const { Block } = require('node-webpipe')
2
+const feedparser = require('feedparser-promised')
3
+
4
+new Block()
5
+ .name('Parse RSS')
6
+ .description('Parse an RSS feed into a series of records.')
7
+ .input('url', 'string', 'The URL for the RSS feed.')
8
+ .output('entries', 'array', 'All entries from the RSS feed')
9
+ .handle((inputs, cb) => {
10
+ const outputs = []
11
+ feedparser.parse(inputs.url).then(items => {
12
+ console.log(items)
13
+ items.forEach(item => {
14
+ outputs.push({
15
+ date: item.date,
16
+ title: item.title,
17
+ link: item.link
18
+ })
19
20
+ cb(null, { entries: outputs })
21
22
23
+ .listen()
0 commit comments