notionRecurringTasksmain.tsx4 matches
3import dayjs from "npm:dayjs";
45const DATABASE_ID = "519446a0d3ed47038fffd669b9ece770";
6const notion = new Client({ auth: process.env.NOTION_API_KEY });
71314export default async function(interval: Interval) {
15const response = await notion.databases.query({
16database_id: DATABASE_ID,
17filter: {
18and: [
4041const nextItem = {
42parent: { database_id: DATABASE_ID },
43properties: {
44...item.properties,
lucia_honomain.tsx2 matches
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";
6667export const schema = { users };
68export type DB = LibSQLDatabase<typeof schema>;
69}
70
sqliteExplorerAppREADME.md1 match
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
sqliteExplorerAppREADME.md1 match
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
sqliteExplorerAppREADME.md1 match
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
checkHackerNewsForPatreonmain.tsx3 matches
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.
49const TABLE_NAME = `${KEY}_notified_stories`;
1011async function initializeDatabase() {
12await sqlite.execute(`
13CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
2021async function checkHackerNewsForPatreon() {
22await initializeDatabase();
2324const response = await fetch("https://hacker-news.firebaseio.com/v0/newstories.json");
notionGetDatabaseREADME.md3 matches
1# Get all the pages in a notion database
23## Usage
451. 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
78Example usage: @stevekrouse.dateMeNotionDatabase
910deno-notion-sdk docs: https://github.com/cloudydeno/deno-notion_sdk
notionGetDatabasemain.tsx4 matches
1export const notionGetDatabase = async ({ databaseId, auth, filter }: {
2databaseId: string;
3auth: string;
4filter?: any;
8);
9const notion = new Client({ auth });
10return collectPaginatedAPI(notion.databases.query, {
11database_id: databaseId,
12filter,
13});
add_to_notion_w_aiREADME.md4 matches
1Uses instructor and open ai (with gpt-4-turbo) to process any content into a notion database entry.
23Use `addToNotion` with any database id and content.
45```
10```
1112Prompts are created based on your database name, database description, property name, property type, property description, and if applicable, property options (and their descriptions).
1314Supports: checkbox, date, multi_select, number, rich_text, select, status, title, url, email
1516- Uses `NOTION_API_KEY`, `OPENAI_API_KEY` stored in env variables and uses [Valtown blob storage](https://esm.town/v/std/blob) to store information about the database.
17- Use `get_notion_db_info` to use the stored blob if exists or create one, use `get_and_save_notion_db_info` to create a new blob (and replace an existing one if exists).
add_to_notion_w_aimain.tsx17 matches
37function createPrompt(title, description, properties) {
38let prompt =
39"You are processing content into a database. Based on the title of the database, its properties, their types and options, and any existing descriptions, infer appropriate values for the fields:\n";
40prompt += `Database Title: ${title}\n`;
4142if (description) {
43prompt += `Database Description: ${description}\n\n`;
44} else {
45prompt += "\n";
111}
112113async function get_and_save_notion_db_processed_properties(databaseId)
114{
115const response = await notion.databases.retrieve({ database_id: databaseId });
116const db_id = response.id.replaceAll("-", "");
117const processed_properties = processProperties(response);
122}
123124async function get_notion_db_info(databaseId) {
125databaseId = databaseId.replaceAll("-", "");
126let db_info = null;
127try {
128db_info = await blob.getJSON(databaseId);
129if (!db_info) {
130throw new Error("db_info is null or undefined");
131}
132} catch (error) {
133db_info = await get_and_save_notion_db_processed_properties(databaseId);
134}
135db_info["zod_schema"] = createZodSchema(db_info["filteredProps"]);
137}
138139async function get_and_save_notion_db_info(databaseId) {
140databaseId = databaseId.replaceAll("-", "");
141let db_info = await get_and_save_notion_db_processed_properties(databaseId);
142db_info["zod_schema"] = createZodSchema(db_info["filteredProps"]);
143return db_info;
283}
284285async function addToNotion(databaseId, text) {
286databaseId = databaseId.replaceAll("-", "");
287const properties = await process_text(databaseId, text);
288console.log(properties);
289const response = await notion.pages.create({
290"parent": {
291"type": "database_id",
292"database_id": databaseId,
293},
294"properties": properties,