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 * as cdk from '@aws-cdk/core'; | |
export class NotionRssFeedStack extends cdk.Stack { | |
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
// your stack definition would go here | |
} | |
} |
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}` | |
}; |
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 * as cdk from '@aws-cdk/core'; | |
import * as lambda from '@aws-cdk/aws-lambda'; | |
export class NotionRssFeedStack extends cdk.Stack { | |
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
// Create the RSS Feed Lambda function | |
const handler = new lambda.Function(this, 'NotionRssFeedHandler', { | |
runtime: lambda.Runtime.NODEJS_14_X, | |
code: lambda.Code.fromAsset('resources/lambda'), |
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 * as cdk from '@aws-cdk/core'; | |
import * as lambda from '@aws-cdk/aws-lambda'; | |
import { config } from 'dotenv'; | |
config() | |
const NOTION_INTEGRATION_TOKEN = process.env.NOTION_INTEGRATION_TOKEN || ''; | |
const NOTION_PAGE_NAME = process.env.NOTION_PAGE_NAME || ''; | |
const RSS_FEED_URL = process.env.RSS_FEED_URL || ''; |
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 { Client } = require("@notionhq/client"); | |
const parser = new Parser(); | |
const notion = new Client({ auth: process.env.NOTION_INTEGRATION_TOKEN }); | |
const page_name = process.env.NOTION_PAGE_NAME; | |
const feed_url = process.env.RSS_FEED_URL; | |
exports.handler = async function (event) { |
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 * as cdk from '@aws-cdk/core'; | |
import * as lambda from '@aws-cdk/aws-lambda'; | |
import * as targets from "@aws-cdk/aws-events-targets"; | |
import * as events from "@aws-cdk/aws-events"; | |
import { config } from 'dotenv'; | |
config() | |
const NOTION_INTEGRATION_TOKEN = process.env.NOTION_INTEGRATION_TOKEN || ''; | |
const NOTION_PAGE_NAME = process.env.NOTION_PAGE_NAME || ''; |