1// View at https://andreterron-htmlExample.web.val.run?name=Andre
2export default async function(req: Request): Promise<Response> {
3 const query = new URL(req.url).searchParams;
4
4const exa = new Exa(exaSecret);
5
6const similarSites = async function(url: string) {
7 const results = await exa.findSimilar(url);
8 if (results.results) {
8};
9
10export async function sendSMS(phoneNumber: string, message: string, carrier: string): Promise<void> {
11 const carrierDomain = carriers[carrier.toLowerCase()];
12 if (!carrierDomain) {
22 text: message,
23 });
24 console.log('Email function returned:', result);
25 console.log('SMS sent successfully');
26 } catch (error) {
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
37
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
4const exa = new Exa(exaSecret);
5
6const similarSites = async function(url: string) {
7 const results = await exa.findSimilar(url);
8 if (results.results) {
4import { render } from "npm:preact-render-to-string";
5
6function FavIcon({ emoji }: { emoji: string }) {
7 return (
8 <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 100 100">
14}
15
16export default async function(req: Request): Promise<Response> {
17 const url = new URL(req.url);
18
1import { randomEmoji } from "https://esm.town/v/karkowg/emojis";
2
3export default async function(req: Request): Promise<Response> {
4 const emoji = randomEmoji();
5
8export const isEmoji = (emoji: string) => emojiPattern.test(emoji) || emojis.includes(emoji);
9
10export function randomEmoji() {
11 return emojis[randomIn(0, emojis.length - 1)];
12}
30};
31
32async function get_val(
33 user: string,
34 val: string,
50}
51
52function show_val(
53 latest_version: number,
54 val: Val,
90 {html`
91 <script type="module">
92 function unescape(str) {
93 return str.replace(
94 /&|<|>|'|"/g,
164});
165
166async function handler(req: Request): Promise<Response> {
167 await track("saolsen.changes", req);
168 return await app.fetch(req);
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.