1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function SearchValTown(query: string) {
4 const input = JSON.stringify({
5 query,
1export function myApi(name) {
2 return "hi " + name;
3}
9
10
11export async function fetchCongressTradeReports(callback) {
12 const res = await fetchJSON(
13 "https://bff.capitoltrades.com/trades?sortBy=-pubDate"
15 const trades = res.data;
16
17 function isToday(d) {
18 const now = new Date();
19 return (
1export async function foo() {
2 const { createPublicClient, http } = await import("npm:viem");
3 const { mainnet } = await import("npm:viem/chains");
2
3// Code emulating the DOE code
4export function currentDateValues(): {
5 schoolYear: `${number}-${number}`;
6 month: string;
2
3type MenuType = (typeof DOEMenuTypes)[number];
4export function dateCalendarKey(opts: {
5 schoolYear: `${number}-${number}`;
6 month: string;
5import { fetchDOEMenu } from "https://esm.town/v/tal/fetchDOEMenu";
6
7export async function fetchAndStore(opts: {
8 schoolYear: `${number}-${number}`;
9 month: string;
3import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts?v=18";
4
5export async function hnFollowShowHNPosts() {
6 let posts = await hnLatestPosts({
7 tags: "show_hn",
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function communityBoatingFlag() {
4 const response = await fetch("https://api.community-boating.org/api/flag");
5 const text = await response.text();
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function emailDailyJoke() {
4 async function fetchJoke() {
5 let response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
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": "*",