1import { email } from "https://esm.town/v/std/email";
2
3export default async function(interval: Interval) {
4 await email({
5 subject: "This is your daily ping!",
165The jsDelivr CDN is highly available with over 110 locations in the world.
166
167You will then have access to the instantsearch function in the global scope (window).
168
169JavaScript
1import { API_URL } from "https://esm.town/v/std/API_URL";
2
3export async function api<T = any>(
4 path: string,
5 options?: RequestInit & {
1import { valTownUser } from "https://esm.town/v/iamseeley/valTownUser";
2
3async function logUserData() {
4 try {
5 const username = await valTownUser.getUsername();
1**👤 valTownUser**
2
3The `valTownUser` object provides a convenient interface to interact with Val Town's API and access user-specific information and functionalities.
4
5## User Information
1import ValTown from "https://esm.sh/@valtown/sdk";
2
3async function server(request: Request): Promise<Response> {
4 const debugMessages: string[] = [];
5
4import { currency } from "https://esm.town/v/stevekrouse/currency";
5
6export async function btcPriceAlert() {
7 const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8 let btcPrice = await currency("usd", "btc");
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",
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
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.