2import { buildHtml } from "https://esm.town/v/liamdanielduffy/buildHtml";
3
4export function reactDemo() {
5 return buildHtml(addReactFromCDN(), "");
6}
1export function toPercentChange(initialValue, currentValue) {
2 return `${((currentValue / initialValue - 1) * 100).toPrecision(2)}%`;
3}
4import { polygonPriceOnWeekdayMsAgo } from "https://esm.town/v/rwev/polygonPriceOnWeekdayMsAgo";
5
6export async function polygonTickerSummary(ticker) {
7 return {
8 day: await polygonPriceOnWeekdayMsAgo(
3import { resume as resume2 } from "https://esm.town/v/ajax/resume";
4
5export async function annoy() {
6 const resume = resume2;
7 // const boo = await import("https://esm.sh/@atproto/api");
2import { rssFeeds } from "https://esm.town/v/ianv/rssFeeds";
3
4export async function pollRSSFeeds({ lastRunAt }) {
5 return Object.entries(rssFeeds).map(async ([name, url]) => {
6 let items = await newRSSItems({
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchRssParser(rssUrl) {
4 // fetch the rss xml
5 const rssResult = await fetch(rssUrl).then((res) => res.text());
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function finalUrl(req: Request) {
4 const url = new URL(req.url).pathname.replace(/^\//, "");
5 const response = await fetch(url);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function alias<P extends Params>(params: P): Promise<Result<P>> {
4 const username = params.username;
5 let url = `https://api.val.town/v1/alias/${username}`;
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function valToString(val: string) {
4 if (val.startsWith("@")) {
5 val = val.slice(1);
1export let remember = function () {
2 console.email("Remember to try val.town for Weather Bot");
3};
A helper function to build a file's email
Simple functional CSS library for Val Town
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": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.