Created
May 16, 2021 15:56
-
-
Save dzmitry-kankalovich/becf5002eb9151e5b6f3f9368ea75b00 to your computer and use it in GitHub Desktop.
Notion RSS - Lambda base
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
const Parser = require('rss-parser'); | |
const parser = new Parser(); | |
exports.handler = async function (event) { | |
console.log("request:", JSON.stringify(event, undefined, 2)); | |
const feed = await parser.parseURL('http://aws.amazon.com/rss/whats-new.rss'); | |
return { | |
statusCode: 200, | |
headers: { "Content-Type": "text/plain" }, | |
body: `${feed.description}` | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment