3import dayjs from "npm:dayjs";
4
5const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
7
13
14export default async function(interval: Interval) {
15 const response = await notion.databases.query({
16 database_id: DATABASE_ID,
17 filter: {
18 and: [
40
41 const nextItem = {
42 parent: { database_id: DATABASE_ID },
43 properties: {
44 ...item.properties,
3import dayjs from "npm:dayjs";
4
5const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
7
13
14export default async function(interval: Interval) {
15 const response = await notion.databases.query({
16 database_id: DATABASE_ID,
17 filter: {
18 and: [
40
41 const nextItem = {
42 parent: { database_id: DATABASE_ID },
43 properties: {
44 ...item.properties,
3import dayjs from "npm:dayjs";
4
5const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
7
13
14export default async function(interval: Interval) {
15 const response = await notion.databases.query({
16 database_id: DATABASE_ID,
17 filter: {
18 and: [
40
41 const nextItem = {
42 parent: { database_id: DATABASE_ID },
43 properties: {
44 ...item.properties,
3import dayjs from "npm:dayjs";
4
5const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
7
13
14export default async function(interval: Interval) {
15 const response = await notion.databases.query({
16 database_id: DATABASE_ID,
17 filter: {
18 and: [
40
41 const nextItem = {
42 parent: { database_id: DATABASE_ID },
43 properties: {
44 ...item.properties,
10import { eq } from "npm:drizzle-orm";
11import { drizzle } from "npm:drizzle-orm/libsql";
12import { LibSQLDatabase } from "npm:drizzle-orm/libsql";
13import { integer, sqliteTable, text } from "npm:drizzle-orm/sqlite-core";
14import { Uuid25 } from "npm:uuid25";
66
67 export const schema = { users };
68 export type DB = LibSQLDatabase<typeof schema>;
69}
70
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
1// This val checks Hacker News for news about Patreon, Buy Me A Coffee, and Ko-fi,
2// sends an email alert if any are found, and keeps track of notified stories in a database.
3// It runs automatically every hour.
4
9const TABLE_NAME = `${KEY}_notified_stories`;
10
11async function initializeDatabase() {
12 await sqlite.execute(`
13 CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
20
21async function checkHackerNewsForPatreon() {
22 await initializeDatabase();
23
24 const response = await fetch("https://hacker-news.firebaseio.com/v0/newstories.json");
1# Get all the pages in a notion database
2
3## Usage
4
51. Find your `databaseId`: https://developers.notion.com/reference/retrieve-a-database
62. Get `auth` by setting up an internal integration: https://developers.notion.com/docs/authorization#internal-integration-auth-flow-set-up
7
8Example usage: @stevekrouse.dateMeNotionDatabase
9
10deno-notion-sdk docs: https://github.com/cloudydeno/deno-notion_sdk