16}
17
18// Function to fetch tweets from a user
19export async function getTweets(username: string) {
20 const userUrl = `https://api.twitter.com/2/users/by/username/${username}`;
21 const userResponse = await fetch(userUrl, {
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
6);
7
8export async function uptimeCheck(url: string) {
9 let ok = true;
10 let reason: string;
166 border-radius: 50%;
167 animation: rise infinite;
168 animation-timing-function: linear;
169 }
170
3import Jimp from "npm:jimp";
4
5export async function blobReadPictureExample(request: Request): Promise<Response> {
6 const searchParams = new URL(request.url).searchParams;
7 const url = searchParams.get("url") || "https://www.browserbase.com";
40 const fieldList = fields.split(',').map(field => field.trim());
41
42 this.idx = lunr(function () {
43 this.ref('id');
44 fieldList.forEach(field => {
25 {
26 role: "user",
27 content: `Here's the description of the function I want to write:
28 ${description}
29 Please start writing the function now, and just write the function, no console.log required:
30 `,
31 },
47};
48
49export async function createVal({ description, valTownKey, code, name, type }) {
50
51 // give it code or generate code
1export default async function (req: Request): Promise<Response> {
2 return new Response('HELLO HELLO', { status: 200 });
3}
1export default async function (req: Request): Promise<Response> {
2 return Response.json( {message: 'hello!!'})
3}
1export default async function (req: Request): Promise<Response> {
2 const message = "HELLO HELLO";
3 return Response.json({message});
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": "*",