Search
teapot
@agmm
An interactive, runnable TypeScript val by agmm
HTTP
export default async function(req: Request): Promise<Response> {
const statusDoc = "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418";
const text = `I am a teapot 🫖\n\n${statusDoc}`;
return new Response(text, { status: 418 });
labLoginGetUsers
@mittzy
An interactive, runnable TypeScript val by mittzy
HTTP
import { sqlite } from "https://esm.town/v/std/sqlite";
export default async function(req: Request): Promise<Response> {
const TABLE_NAME = "loginredux_users";
// get status, name, and last_updated cols
const query = await sqlite.execute({
sql: `SELECT status, username, last_updated, id FROM ${TABLE_NAME} where banned = 0`,
args: [],
return new Response(JSON.stringify(query.rows), { status: 200 });
gh_releases
@just_be
An interactive, runnable TypeScript val by just_be
HTTP
export default async function server(request: Request): Promise<Response> {
const url = new URL(request.url);
const parts = url.pathname.split("/").filter(Boolean);
if (parts.length !== 4) {
return renderFallbackPage(request.url);
const [owner, repo, releaseVersion, file] = parts;
const cacheKey = `${owner}/${repo}/${releaseVersion}/${file}`;
// Try to get the file from the cache
const [_, cachedFile] = await to(blob.get(cacheKey));
if (cachedFile) {
typewriter
@iamseeley
⌨️ simple typing effect /* Styles */
.typewriter {
font-size: 1.1em;
color: #ecf0f1;
}
.typewriter span {
padding-right: 2px;
border-right: 1px solid #ecf0f1;
white-space: nowrap;
overflow: hidden;
}
Script
## ⌨️ simple typing effect
```CSS
/* Styles */
.typewriter {
font-size: 1.1em;
color: #ecf0f1;
export function typeWriter(element, text, callback = () => {}) {
let i = 0;
function type() {
if (i < text.length) {
githubcollabgen
@ejfox
GitHub Collaboration Suggester This tool analyzes the recent GitHub activity of two users and suggests potential collaboration opportunities. Features Fetches the last 3 months of GitHub activity for two users Summarizes activity including event counts, repositories, commits, issues, and pull requests Uses AI to generate collaboration suggestions based on the activity summaries Usage To use it, make a GET request with two GitHub usernames as query parameters: https://ejfox-githubcollabgen.web.val.run?user1=<username1>&user2=<username2> Curl Compare two specific users: curl "https://ejfox-githubcollabgen.web.val.run?user1=ejfox&user2=stevekrouse" Response The API returns a plain text response with AI-generated collaboration suggestions, including: Potential collaborative projects Technologies to explore or learn Ways to complement each other's skills Opportunities for knowledge sharing or mentoring Possible open-source contributions
HTTP
# GitHub Collaboration Suggester
This tool analyzes the recent GitHub activity of two users and suggests potential collaboration opportunities.
## Features
- Fetches the last 3 months of GitHub activity for two users
- Summarizes activity including event counts, repositories, commits, issues, and pull requests
- Uses AI to generate collaboration suggestions based on the activity summaries
const OPENAI_API_KEY = "your_openai_api_key"; // Replace with your actual OpenAI API key
export default async function main(req: Request): Promise<Response> {
const url = new URL(req.url);
const user1 = url.searchParams.get("user1") || "ejfox";
farcasterFlings
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
HTTP
import { fetch } from "https://esm.town/v/std/fetch";
export const farcasterFlings = (async () => {
let FARCASTER_USERNAME = "whatrocks";
let flings = await fetch(
`https://searchcaster.xyz/api/search?regex=%E2%8C%86&username=${FARCASTER_USERNAME}`,
).then((res) => res.json());
let filteredCasts = flings.casts.filter((cast) =>
cast.body.data.text[0] === "⌆"
return filteredCasts;
tldraw_computer_example
@ni5k0
tldraw computer custom endpoint example This val is an example custom endpoint for tldraw computer 's data component. Usage To use this val with tldraw.computer, follow these steps: Fork this Val. Click the Copy endpoint button on your new Val. Open a project on tldraw.computer Create a Data component in your tldraw computer project In the Source dropdown, select Custom and the POST method Paste the endpoint into Data component's the HTTP Endpoint input. Run the component. To see the output, connect the Data component to a Text component. How it works In tldraw computer, you can configure a Data component to use a custom HTTP endpoint as its data source. You can also configure the request method, either GET or POST. If a Data component's request method is POST, then when the component next updates, it will send a POST request to the endpoint. The request's body will contain an array of the Data objects that the component had received as inputs. If the request method if GET, then the component will only make the request—its body will be empty. In both cases, the component will expect back a response that includes an array of Data objects these objects will be passed along as the data component's outputs. The endpoint (your forked version of this Val) can do whatever it likes between the request and response, but the response must include data in the correct format. If the format is wrong, the computer app will create a text data object instead that includes the response as plain text. Support If you're running into any difficulties, check out the #tldraw-computer channel on the tldraw discord.
HTTP
# tldraw computer custom endpoint example
This val is an example custom endpoint for [tldraw computer](tldraw.computer)'s data component.
### Usage
To use this val with tldraw.computer, follow these steps:
1. Fork this Val.
2. Click the **Copy endpoint** button on your new Val.
// This endpoint accepts and returns data.
type BooleanData = {
type: "boolean";
text: "true" | "false" | "maybe";
getRaycastDownloadCount
@shayne
An interactive, runnable TypeScript val by shayne
Script
export const getRaycastDownloadCount = (async () => {
const { DOMParser } = await import(
"https://deno.land/x/deno_dom/deno-dom-wasm.ts"
const url = "https://www.raycast.com/tailscale/tailscale";
const response = await fetch(url);
const html = await response.text();
const document = new DOMParser().parseFromString(html, "text/html");
const data = await JSON.parse(
document.getElementById("__NEXT_DATA__").textContent
return data.props.pageProps.fallback["users/tailscale/extensions/tailscale"]
tidbytDeviceInfo
@andreterron
An interactive, runnable TypeScript val by andreterron
Script
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
export function tidbytDeviceInfo({ deviceId, apiKey }: {
deviceId: string;
apiKey: string;
return fetchJSON(
`https://api.tidbyt.com/v0/devices/${deviceId}`,
headers: {
Authorization: `Bearer ${apiKey}`,
map_examples
@gloodata
Gloodata Map JavaScript Extension A sample JavaScript extension for Gloodata that shows examples of the map features. Register the extension in Gloodata, give it any name you want, like "Map Examples Val Town" and the endpoint url like https://gloodata-extmapexamples.web.val.run, if you fork the val change the url to yours. Learn more about how to register an extension here: How to Register a Gloodata Extension . Switch from Preview to Code below to see how it's implemented.
HTTP
# Gloodata Map JavaScript Extension
A sample JavaScript extension for [Gloodata](https://gloodata.com/) that shows examples of the map features.
Register the extension in Gloodata, give it any name you want, like "Map Examples Val Town" and the endpoint url like https://gloodata-extmapexamples.web.val.run, if you fork the val change the url to yours.
Learn more about how to register an extension here: [How to Register a Gloodata Extension](https://gloodata.com/guides/register-extension/).
Switch from `Preview` to `Code` below to see how it's implemented.
const FN_MAP = "FnMap";
async function getInfo() {
return {
title: "Map Examples (JavaScript)",
ns: "ext-js-map-examples",
SolanaJupiterSwapEventParser
@ryoid
An interactive, runnable TypeScript val by ryoid
Script
const input = bytes(`
04 e9 e1 2f bc 84 e8 26 c9 32 cc e9 e2 64 0c ce
15 59 0c 1c 62 73 b0 92 57 08 ba 3b 85 20 b0 bc
06 9b 88 57 fe ab 81 84 fb 68 7f 63 46 18 c0 35
da c4 39 dc 1a eb 3b 55 98 a0 f0 00 00 00 00 01
a0 86 01 00 00 00 00 00 05 2e e1 83 38 96 96 9f
8c d1 cd 46 83 18 c5 98 c7 e0 58 96 07 4a 59 1c
2a e0 98 60 2f 16 80 00 d9 34 05 00 00 00 00 00
export function publicKey(data: Uint8Array, offset: number) {
return base58.encode(data.subarray(offset, offset + 32));
effector
@effector
An interactive, runnable TypeScript val by effector
Script
export async function effector() {
const effector = await import("https://esm.sh/effector@22.8.6");
return effector;
MattsSFsailingNotify
@brezina
// Copilot output maxWind and maxTemp_f to hmtl
Script
export async function sailingNotify(
where: string,
minWindMph = 1,
minTemp = 1,
const forecast = await getWeather(where, 10);
// Could filter only for hours during the day.
// forecast.forecast.forecastday.map((day) => {
// day.hour.map((hour) => {
// const hourInt = parseInt(hour.time.split(" ")[1].split(":")[0]);
// if (hourInt >= 10 && hourInt <= 19) {
LoginPeloton
@steveb1313
An interactive, runnable TypeScript val by steveb1313
Script
export async function LoginPeloton(
req: express.Request,
res: express.Response,
let response = await fetch("https://api.onepeloton.com/auth/login", {
method: "POST",
mode: "no-cors",
headers: {
"Content-Type": "application/json",
// 'Content-Type': 'application/x-www-form-urlencoded',
body: JSON.stringify({