1export function denoServer(handler: (req: Request) => Response | Promise<Response>, thisArg?: any) {
2 if (thisArg) {
3 handler = handler.bind(thisArg);
18);
19
20export default async function(req: Request) {
21 return new Response(
22 `
1export function denoServer(handler: (req: Request) => Response | Promise<Response>, thisArg?: any) {
2 if (thisArg) {
3 handler = handler.bind(thisArg);
32);
33
34export default async function(req: Request) {
35 return new Response(
36 `
1// View at https://lmackenzie94-htmlExample.web.val.run?name=Luke
2export default async function(req: Request): Promise<Response> {
3 const query = new URL(req.url).searchParams;
4
4const query = "\"val.town\" OR \"val town\" -_ValTown_";
5
6export async function twitterAlert({ lastRunAt }: Interval) {
7 const results = await twitterSearch({
8 query,
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI";
3
4export default async function(interval: Interval) {
5 const location = "Geneva"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });
35
36export const hydrate = (importMetaURL: string) =>
37 async function(req: Request): Promise<Response> {
38 const { author, name } = extractValInfo(importMetaURL);
39 const valURL = `https://www.val.town/v/${author}/${name}`;
10 * @param authorization
11 */
12export async function telegramText(text: string, options?: TextOptions, authorization?: string) {
13 return telegramRequest("text", { text, options }, authorization);
14}
20 * @param authorization
21 */
22export async function telegramPhoto(options: PhotoOptions, authorization?: string) {
23 return telegramRequest("photo", { options }, authorization);
24}
25
26async function telegramRequest(path, body, authorization?: string) {
27 const response = await fetch("https://stevekrouse-telegramValTownAPI.web.val.run/" + path, {
28 method: "POST",
47 * @deprecated since 4/20/2024
48 */
49export async function telegram(secret: string, text: string, options?: MergedOptions) {
50 return runVal("stevekrouse.telegramValTownBot", secret, text, options);
51}
42};
43
44function handleTelegramResponse(response) {
45 console.log(response);
46 if (response.ok) {
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": "*",