3import xml2js from "npm:xml2js";
4
5async function fetchHistoricData() {
6 const currentDate = new Date();
7 const promises = [];
60}
61
62export default async function(interval: Interval) {
63 const history = await fetchHistoricData();
64
7} as Record<string, string>;
8
9export default async function(req: Request): Promise<Response> {
10 if (req.method === "OPTIONS") {
11 return new Response("ok", { headers: structuredClone(CORS_HEADERS) });
18})();
19
20export default async function(req: Request): Promise<Response> {
21 await init;
22 return Response.json([
6);
7
8export async function uptimeCheck(url: string) {
9 let reason: string, status: number, end: number;
10 let ok = true;
5import { renderToString } from "npm:react-dom/server";
6
7function StatusRow({ rows }) {
8 return (
9 <div className="w-full flex flex-col space-y-2">
28}
29
30function StatusSection({ url, rows }) {
31 const sectionRows = rows.filter(row => row[0] === url);
32 const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
44}
45
46export default async function(req: Request): Promise<Response> {
47 const { rows } = await sqlite.execute(
48 "select url, ok, duration, timestamp from uptime order by timestamp desc limit 200",
11];
12
13export async function sendEmailNewsletter(interval: Interval) {
14 const { jsx: newsletterContent, subject, webUrl, targetSendDate } = newsletters[newsletters.length - 1];
15
2import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
3
4export function getJune2024Newsletter() {
5 const subject = "#2 — June 2024";
6 const webUrl = "https://petemillspaugh.com/june-2024";
138}
139
140async function insertIntoNewslettersTable() {
141 const { subject, webUrl, targetSendDate } = getJune2024Newsletter();
142
5`);
6
7function uint64(data: Uint8Array) {
8 let result = 0n;
9 for (let i = 0; i < data.length; i++) {
15console.log(uint64(input));
16
17function bytes(str: string): Uint8Array {
18 return base16.decode(str.replaceAll(/\s/g, "").toUpperCase());
19}
6`);
7
8function publicKey(data: Uint8Array) {
9 return base58.encode(data);
10}
12console.log(publicKey(input));
13
14function bytes(str: string): Uint8Array {
15 return base16.decode(str.replaceAll(/\s/g, "").toUpperCase());
16}
307};
308
309// To test the function
310bookReservationOnResy({
311 reservation: {
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",