2
3
4export default function Nav({ currentPath }) {
5 const isEditProfilePath = currentPath && currentPath.startsWith('/edit-profile/');
6
4import { currency } from "https://esm.town/v/stevekrouse/currency";
5
6export async function btcPriceAlert() {
7 const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8 let btcPrice = await currency("usd", "btc");
2
3
4export default function AddLink({ username }) {
5 return (
6 <form action="/links" method="post" id="new-link" hx-push-url={`/edit-profile/${username}`} className="space-y-4">
1## Get Weather
2
3Simple function to get weather data from the free [wttr.in](https://wttr.in/:help) service.
4
5```ts
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(location: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${location}?format=j1`);
5}
18}
19
20export default function UserWidgets({ user }: UserWidgetsProps) {
21 return (
22 <div>
1import { email } from "https://esm.town/v/std/email?v=11";
2
3export function forwarder(e: {
4 from: string;
5 to: string[];
7import { Hono } from "npm:hono@3";
8
9function esmTown(url) {
10 return fetch(url, {
11 headers: {
2import { thisWebURL } from "https://esm.town/v/stevekrouse/thisWebURL";
3
4async function alphaVantage(symbol: string) {
5 let data = await fetchJSON(
6 `https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=${symbol}&apikey=${Deno.env.get("alphaVantage")}`,
7 );
8 return data;
9}
10
11export function getStockData(symbol: string) {
12 return fetchJSON(
13 `${thisWebURL()}?symbol=${symbol}`,
15}
16
17export function getStockPrice(symbol: string) {
18 return getStockData(symbol).then((data) => data["Global Quote"]["05. price"]);
19}
7import { Hono } from "npm:hono@3";
8
9function esmTown(url) {
10 return fetch(url, {
11 headers: {
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.