10const UFE0Fg = /\uFE0F/g;
11
12export function getIconCode (char: string) {
13 return toCodePoint(!char.includes(U200D) ? char.replace(UFE0Fg, "") : char);
14}
15
16function toCodePoint (unicodeSurrogates: string) {
17 const r = [];
18 let c = 0;
56const emojiCache: Record<string, Promise<string>> = {};
57
58export async function loadEmoji (type: keyof typeof apis, code: string) {
59 const key = `${type}:${code}`;
60
69 const api = apis[type];
70
71 if (typeof api === "function") {
72 return (emojiCache[key] = fetch(api(code)).then(async r => r.text()));
73 }
1import { powderNotify } from "https://esm.town/v/chet/powderNotify";
2
3export default async function(interval: Interval) {
4 await Promise.all([
5 powderNotify("Truckee, CA"),
3import process from "node:process";
4
5export async function sailingNotifyCron({ lastRunAt }) {
6 const result = await sailingNotify("Fair Oaks, CA", 10);
7}
2import process from "node:process";
3
4export async function frostNotifyCron(interval: Interval) {
5 await frostNotify("Fair Oaks, CA");
6}
2import { email } from "https://esm.town/v/std/email";
3
4export async function frostNotify(
5 where: string,
6 minTempF = 33,
2import { email } from "https://esm.town/v/std/email";
3
4export async function sailingNotify(
5 where: string,
6 minWindMph = 10,
3
4/** Must set process.env.WEATHER_API_KEY for weatherapi.com **/
5export async function getWeather(
6 query: string,
7 days = 10,
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function greenhouseToRSS(req: Request) {
4 const { Feed } = await import("npm:feed");
5 const searchParams = new URL(req.url).searchParams;
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function leverToRSS(req: Request) {
4 const { Feed } = await import("npm:feed");
5 const { XMLParser } = await import("npm:fast-xml-parser");
30}
31
32export function createVal({ token, code, name, readme, privacy }: CreateValArgs): Promise<ValResponse> {
33 const body: Record<string, unknown> = {
34 code,
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": "*",