1export function jsonArrayToJsonL(arr: Array<any>) {
2 let output = "";
3 for (const item of arr) {
31console.log(text);
32
33export async function weatherGPT() {
34 await email({ subject: "Weather Today", text });
35}
1export default async function handler(req: Request): Promise<Response> {
2 const resumeJSON = {
3 "basics": {
1export async function hostResume(jsonResume, apiKey) {
2 const userDetailsEndpoint = 'https://api.val.town/v1/me/';
3 const createValEndpoint = 'https://api.val.town/v1/vals/';
26 },
27 body: JSON.stringify({
28 code: `export default async function handler(req: Request): Promise<Response> {
29 const resumeJSON = ${JSON.stringify(jsonResume, null, 2)};
30 const resume = JSON.stringify(resumeJSON);
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
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);
45}
46
47export default async function(req: Request): Promise<Response> {
48 const { rows } = await sqlite.execute(
49 "select url, ok, duration, timestamp from uptime order by timestamp desc",
6);
7
8export async function uptimeCheck(url: string) {
9 let ok = true;
10 let reason: string;
4import { resumeConfig } from 'https://esm.town/v/iamseeley/pinkBear';
5
6export default async function resumeHandler(req: Request): Promise<Response> {
7 if (req.method === 'GET') {
8 try {
4import { resumeConfig } from 'https://esm.town/v/iamseeley/resumeConfig';
5
6export default async function resumeHandler(req: Request): Promise<Response> {
7 if (req.method === 'GET') {
8 try {
13
14const clientCode = () => {
15 document.getElementById("input").addEventListener("submit", async function(event) {
16 event.preventDefault();
17
45 + `&assistantId=${input.getAttribute("data-assistant-id")}`,
46 );
47 eventSource.onmessage = function(event) {
48 console.log(event);
49 responseDiv.innerText += JSON.parse(event.data);
50 };
51
52 eventSource.onerror = function() {
53 eventSource.close();
54 };
A helper function to build a file's email
Simple functional CSS library for Val Town
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": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.