35Make an HTTP val (other vals are currently not supported to run, even though we have examples for them).
36Start your response with a comment explaining how your approach will work, what libraries or
37API calls you will use, and any tradeoffs you're making. Then write the code in a consise way,
38the simplest way to achieve the goal, though you can add some inline comments to explain your
39reasoning (not for every line, but for major groups of lines). Don't use any environment variables
40unless strictly necessary, for example use APIs that don't require a key, prefer internal function
41imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
42functions where possible. Unless specified, don't add error handling,
43make sure that errors bubble up to the caller.
44Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's
45not practical for the user's request (e.g. if they ask for a particular animated gif).
46If the user asks for something that requires persistence, use the Val Town Blob storage API, unless
47explicitly specified otherwise. Use the current val name for the storage key, which you can get
48using the "pomdtr/extractValInfo" val, which you can call like this:
422const tempValName = `valle-tmp-${Math.random() * 10}`.replaceAll(".", "");
423const newCode = tokens.join("").replaceAll("```ts", "").replaceAll("```", "").replace(/^ts\n/, "");
424// Errors in running the val bubble up through this API, so ignore them.
425await vt.vals.create({ name: tempValName, code: newCode, type: "httpnext" as any, privacy: "unlisted" }).catch(
426(error) => {
3Speech-to-text and chapter summaries powered by [Substrate](https://substrate.run)
45🪩 To fork, [sign up for Substrate](https://substrate.run/signin) to get your own API key and $50 free credits
2324async function processAudio(audio_uri) {
25const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });
26const opts = { cache_age: 60 * 60 * 24 * 7 };
27103<link rel="icon" href="https://www.substrate.run/favicon.ico" type="image/x-icon">
104<link
105href="https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap"
106rel="stylesheet"
107/>
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
1112<img width=500 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7077d1b5-1fa7-4a9b-4b93-f8d01d3e4f00/public"/>
crypto_prices_infomain.tsx4 matches
1const TELEGRAM_CHAT_ID = Deno.env.get("TELEGRAM_CHAT_ID");
2const TELEGRAM_TOKEN = Deno.env.get("TELEGRAM_TOKEN");
3const COINGECKO_API_KEY = Deno.env.get("COINGECKO_API_KEY");
45const getCryptoPrices = async () => {
6const response = await fetch(
7"https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=bitcoin,ethereum,dogecoin,solana,binancecoin,ripple,pepe",
8{
9headers: {
10"accept": "application/json",
11"x-cg-demo-api-key": COINGECKO_API_KEY,
12},
13},
51const sendTextWithTelegram = async (text) => {
52const telegramSendUrl =
53`https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage?chat_id=${TELEGRAM_CHAT_ID}&parse_mode=HTML&disable_notification=true&text=${text}`;
54await fetch(telegramSendUrl);
55};
sqliteExplorerAppREADME.md1 match
13## Authentication
1415Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
1617## Todos / Plans
sqliteExplorerAppmain.tsx2 matches
27<head>
28<title>SQLite Explorer</title>
29<link rel="preconnect" href="https://fonts.googleapis.com" />
3031<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32<link
33href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34rel="stylesheet"
35/>
glideImportDemoREADME.md4 matches
1# Glide API 2.0: Bulk Import
23You can fork this Val to implement your own bulk import to Glide.
45Glide's high-performance bulk import API can load millions of rows
6into Big Tables. It's designed for importing your business data
7into Glide on a regular schedule (e.g. nightly).
89We designed this API for customers who regularly import tens of
10thousands of rows or more to Glide using tools like Make. Our goal
11was to make this process more efficient and less expensive.
1213Note: This API is currently free to use. Future usage will cost
14approximately 1 update per 10k rows.
15
getSpotifyTrackUrlmain.tsx1 match
6970// Search for the track
71const response = await fetch(`https://api.spotify.com/v1/search?q=${query}&type=track`, {
72headers: {
73"Authorization": `Bearer ${accessToken.access_token}`,