3const db = new ValTupleStorage("email");
45export async function generateEmailKey() {
6const key = Math.random().toString().slice(3);
717}
1819export async function listEmailKeys() {
20const emailKeys = await db.scan();
21console.log("Email keys:", emailKeys);
22}
2324export async function expireEmailKey(key: string) {
25const expires = Date.now() - 1;
26await db.write({ set: [{ key: [key], value: expires }] });
27}
2829export async function authenticateEmailKey(key: string) {
30const result = await db.scan({ gte: [key], lte: [key], limit: 1 });
31if (result.length === 0) return "Invalid key.";
34}
3536export async function resetEmailKeys() {
37await db.destroy();
38}
add_to_notion_w_ai_webpagemain.tsx10 matches
39});
4041function createPrompt(title, description, properties) {
42let prompt =
43"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";
84}
8586function processProperties(jsonObject) {
87const properties = jsonObject.properties;
88const filteredProps = {};
115}
116117async function get_and_save_notion_db_processed_properties(databaseId)
118{
119const response = await notion.databases.retrieve({ database_id: databaseId });
126}
127128async function get_notion_db_info(databaseId) {
129databaseId = databaseId.replaceAll("-", "");
130let db_info = null;
142}
143144async function get_and_save_notion_db_info(databaseId) {
145databaseId = databaseId.replaceAll("-", "");
146let db_info = await get_and_save_notion_db_processed_properties(databaseId);
149}
150151function createZodSchema(filteredProps) {
152const schemaObject = {};
153198}
199200function convertToNotionProperties(responseValues, filteredProps) {
201const notionProperties = {};
202273}
274275async function process_text(dbid, text) {
276const db_info = await get_notion_db_info(dbid);
277const processed_message = await client.chat.completions.create({
288}
289290async function addToNotion(databaseId, text) {
291databaseId = databaseId.replaceAll("-", "");
292const properties = await process_text(databaseId, text);
301}
302303export default async function(req: Request) {
304if (req.method === "POST") {
305const content = (await req.formData()).get("content");
add_to_notion_w_aimain.tsx9 matches
35});
3637function 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";
80}
8182function processProperties(jsonObject) {
83const properties = jsonObject.properties;
84const filteredProps = {};
111}
112113async function get_and_save_notion_db_processed_properties(databaseId)
114{
115const response = await notion.databases.retrieve({ database_id: databaseId });
122}
123124async function get_notion_db_info(databaseId) {
125databaseId = databaseId.replaceAll("-", "");
126let db_info = null;
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);
144}
145146function createZodSchema(filteredProps) {
147const schemaObject = {};
148193}
194195function convertToNotionProperties(responseValues, filteredProps) {
196const notionProperties = {};
197268}
269270async function process_text(dbid, text) {
271const db_info = await get_notion_db_info(dbid);
272const processed_message = await client.chat.completions.create({
283}
284285async function addToNotion(databaseId, text) {
286databaseId = databaseId.replaceAll("-", "");
287const properties = await process_text(databaseId, text);
untitled_roseGuanacomain.tsx1 match
1import { html } from "https://esm.town/v/stevekrouse/html";
23export default async function(req: Request): Promise<Response> {
4// return new Response("<h1>Hello FRC!</h1>", { headers: {
5// "Content-Type": "text/html"
trendingreposmain.tsx7 matches
1import { fetch } from "https://esm.town/v/std/fetch";
23// Helper function to format the date for GitHub API query
4function formatDate(daysAgo: number): string {
5const date = new Date();
6date.setDate(date.getDate() - daysAgo);
8}
910// Function to fetch top GitHub repositories based on stars and creation date
11async function topGitHubRepos(stars: number, daysAgo: number, timeframeDescription: string) {
12const date = formatDate(daysAgo);
13const query = `stars:>${stars} created:>${date}`;
23}
2425// Function to get combined information for different criteria
26export async function getTopReposByCriteria() {
27const reposLastWeek = await topGitHubRepos(1000, 7, "Created Last Week"); // Last week, over 1000 stars
28const reposLastMonth = await topGitHubRepos(3000, 30, "Created Last Month"); // Last month, over 3000 stars
33}
3435// Call the function to get and print the information
36getTopReposByCriteria().then(console.log);
1export async function prune_val(
2val_id: string,
3keep_versions: number[],
1export default async function() {
2const res = await fetch("https://api.manifold.markets/request-loan", {
3headers: {
untitled_indigoMolluskmain.tsx2 matches
6import { post_idFetcher } from "https://esm.town/v/willthereader/post_idFetcher";
78export async function Sendingemail() {
9// console.log("Sendingemail function called");
10try {
11let lastRunDate = new Date("2023-11-10T19:27:25.547Z");
react_maplibremain.tsx1 match
2import { renderToString } from "npm:react-dom/server";
34export default async function(req: Request) {
5return new Response(
6renderToString(
untitled_beigeLemurmain.tsx1 match
20};
2122export default async function(req: Request) {
23return new Response(
24renderToString(