1import { checkAvail } from "https://esm.town/v/lirenxn/checkAvail";
23export async function runCheckUnderground() {
4const result = await checkAvail({
5type: "underground",
3import { set } from "https://esm.town/v/std/set?v=11";
45export async function runCheckUnderground2() {
6const result = await checkAvail({
7type: "underground",
ColosseummailMeTheLink.tsx1 match
1112**/
13export function mailMeTheLink({ calLink, date, type, slots }: {
14calLink: string;
15date: string;
nell-parker-townindex.ts1 match
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
Work_Time_Calculator_2main.tsx7 matches
1function parseTimeRanges(daySchedule) {
2// console.log(`Parsing schedule: ${daySchedule}`);
3const timeRanges = daySchedule.match(/(\d{1,2}(?::\d{2})?(?:am|pm)?)/g);
53}
5455function convertTo24HourFormat(time) {
56if (!time) {
57throw new Error("Invalid time input: time is undefined or empty");
91}
9293function calculateDuration(day, startTime, endTime) {
94console.log(`calculateDuration: Calculating duration on ${day} from ${startTime} to ${endTime}`);
95const start24 = convertTo24HourFormat(startTime);
112}
113114function calculateDailyTotal(day, parsedSchedule) {
115console.log(`calculateDailyTotal: Calculating daily total for ${day}`, parsedSchedule);
116let totalMinutes = 0;
130}
131132function calculateWeeklyTotal(day, dailyTotals) {
133console.log(`calculateWeeklyTotal: Calculating weekly total for daily totals for ${day} is`, dailyTotals);
134let totalHours = 0;
148}
149150function isValidDay(day) {
151const validDays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
152return validDays.includes(day.charAt(0).toUpperCase() + day.slice(1).toLowerCase());
153}
154155function calculateWorkTime(schedule) {
156const dailyTotals = [];
157const scheduleArray = schedule.split("\n").filter(Boolean);
1export default async function handleRequest(request: Request): Promise<Response> {
2// this is a function called handleRequest that is exported for use elsewhere and accepts one input
3const { url } = await request.json();
4// the variable url cannot be changed and to the code to wait until the HTTP data is read and and turned into JSON
ValTownForNotionresets1 match
7});
89export default async function(interval: Interval) {
10const subdomain = "valtownfornotion";
11const items = await blob.list(subdomain);
ValTownForNotionnotionHelpers.ts20 matches
7});
89export async function createDatabasePagesParallel(databaseId: string, pages: []) {
10const creations = pages.map((page) =>
11notion.pages.create({
4344// delete all database rows
45export async function deleteAllDatabasePagesParallel(databaseId: string) {
46const pageIds = await notion.databases.query({
47database_id: databaseId,
59}
6061export async function getDatabaseId(databaseTitle: string) {
62// getDatabaseId(databaseTitle)
63const database = await notion.databases
66}
6768export async function getDatabaseTitle(databaseId: string) {
69// getDatabaseTitle(databaseId)
70const database = await notion.databases.retrieve({ database_id: databaseId });
73}
7475export async function getDatabaseParentPageId(databaseId: string) {
76let currentBlockId = databaseId;
7798}
99100export async function getCalloutProperties(askingFor: string) {
101const blockProperties = (askingFor != "val.town")
102? {
121}
122123export async function findChildDatabaseBlocks(rootBlockId: string, blockIdentifier: string) {
124const matchingBlocks = [];
125126async function searchBlock(blockId) {
127const res = await notion.blocks.children.list({ block_id: blockId });
128165}
166167export async function findCalloutBlocks(rootBlockId: string, blockIdentifier: string) {
168const matchingBlocks = [];
169170async function searchBlock(blockId) {
171const res = await notion.blocks.children.list({ block_id: blockId });
172200}
201202export async function getBostonTime() {
203const now = new Date();
204213}
214215export async function listChildrenChildPages(blockId: string) {
216try {
217const response = await notion.blocks.children.list({
229}
230231export async function addFavicon(data?: any) {
232const pageId = data?.id;
233// use notion if nothing if the URL property is empty
234const url = await getWebhookPropertyValue(data, "Website") || "notion.com";
235// send the URL value to the function that will get the site's favicon location
236const faviconURL = await helpers.scrapeFaviconUrl(url);
237console.log({ "Verified favicon URL": faviconURL });
242}
243244export async function setPageStatus(object: any) {
245const { data, section, step } = object;
246const pageId = data?.id;
282}
283284export async function updatePageIcon(pageId: string, faviconURL?: string) {
285try {
286const response = await notion.pages.update({
302}
303304export async function listChildren(pageId: string) {
305// get page properties
306try {
318}
319320// Helper function to get property value from webhook payload
321export async function getWebhookPropertyValue(payload: any, propertyName: any) {
322let result = null;
323// check to see if the whole payload was sent, or just the data object
357}
358359export async function getNotionPage(pageId: string) {
360// get page properties
361try {
ValTownForNotionhelpers.ts5 matches
1export async function setBlobKey(object: any) {
2const { slug, clientPageId, containerId } = object;
3const blobKey = [ // key_legend: "[subdomain]--[id of guest page]--[id of container to be reset]",
11}
1213export async function slugify(str: string) {
14// const containerTitleSlug = (await helpers.setContainerTitle(c.req.headers.get("x-container-title"))).split(" ").join("-");
15return (str.replace(/[^\w\s]|_/g, "").replace(/\s+/g, " ").trim().toLowerCase()).split(" ").join("-");
16}
1718// Function to scrape favicon URL from a website
19export async function scrapeFaviconUrl(url: string) {
20try {
21// Ensure URL has protocol
75}
7677export async function extractCamelCaseWords(str: string) {
78if (!str) return [];
79
5859// if the blob exists that maps to this callout for this user, use the id property inside it
60// otherwise call the function to find the id of the callout for this user
61// const blockId = blobject // if therre's a blob, then this isn't the first call
62// ? blobject.id // use the id in the blob to speed up subsequent calls