3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
4
5export async function openAqNowcastAQI({ location_id }) {
6 const { results } = await fetchJSON(
7 "https://api.openaq.org/v2/measurements?" +
1import { thisExpressURL } from "https://esm.town/v/stevekrouse/thisExpressURL";
2
3export function testThisExpressUrl(req, res) {
4 let url = thisExpressURL();
5 res.send(`<a href="${url}">${url}</a>`);
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
3
4// this function doesn't work yet, I'm still iterating on it
5export function fetchHTML(url: string, options?: any) {
6 return fetchText(url, options)
7 .then(parseHTML);
3
4// Get the title of the top story on Hacker News
5export async function hnTopTenStories() {
6 const topStories: Number[] = await fetch(
7 "https://hacker-news.firebaseio.com/v0/beststories.json?print=pretty",
1export function myApi(name) {
2 return "hi " + name;
3}
1let { miraclechildcounter } = await import("https://esm.town/v/politelyinvinciblepointer/miraclechildcounter");
2
3export function increasemiraclechildcounter() {
4 miraclechildcounter++;
5}
1export function myApi(name) {
2 return "hi " + name;
3}
1import { stopDepartures } from "https://esm.town/v/kognise/stopDepartures";
2
3export async function stopDeparturesSingleCountdown(globalStopId: string) {
4 const res = await stopDepartures(globalStopId);
5 return res[0].itineraries[0].schedule_items.map((bus) => ({
1export function feedback(content) {
2 console.email("Feedback: " + content);
3 return "ok";
1export function myApi(name) {
2 return "hi " + name;
3}
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": "*",