42 - Value: Your SERP API key.
43
44Without this key, the val will not function correctly.
45
46---
58- Key: `mentionsDiscord`
59- Value: Your Discord webhook URL.
60Notifications will be sent using this function:
61```
62 await discordWebhook({
8 * Val Town HTTP val – returns the mask-editor page.
9 */
10export default async function(req: Request): Promise<Response> {
11 const body = "<!DOCTYPE html>" + render(<HTML />);
12 return new Response(body, {
3import { useEffect, useRef, useState } from "npm:preact/hooks";
4
5export default function App() {
6 const [imageSrc, setImageSrc] = useState<string | null>(null);
7 const [ready, setReady] = useState(false);
4// import { h } from "preact";
5
6export function HTML() {
7 return (
8 <html>
4import { TABLE_NAME } from "./updateTable";
5
6export default async function(req: Request): Promise<Response> {
7 // body contains:
8 // - title (string)
2
3export const TABLE_NAME = "pondiverse_creations_v5";
4export default async function(req: Request): Promise<Response> {
5 await sqlite.execute(
6 `CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
1// main.tsx
2
3export default async function(req: Request): Promise<Response> {
4 const url = new URL(req.url);
5
5#### Python code for display available at https://github.com/michaelwschultz/eink-frame
6
7## Functioning Hardware
8
9| News | NASA Photo of the Day |
5import { BodyWrapper, Content, Footer, Header, Headline } from "../components.tsx";
6
7function getWeatherCondition(code: number): string {
8 const conditions: { [key: number]: string } = {
9 0: "Clear sky",
27}
28
29function Render({ weather }: { weather: WEATHER_FORECAST }) {
30 return (
31 <html>
54}
55
56export default async function(req: Request): Promise<Response> {
57 // You can find your coordinates here: https://www.latlong.net/
58 const latitude = 37.5296;
27};
28
29export default async function(
30 req: Request,
31 latitude: number = 37.5296,
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": "*",