Search

Results include substring matches and semantically similar vals. Learn more
eczajk avatar
ivoryGiraffe
@eczajk
Phish Calendar Phish tour date that can be added to your calendar.
HTTP
# Phish Calendar
Phish tour date that can be added to your calendar.
export default async function(req: Request): Promise<Response> {
const url = `https://api.phish.net/v5/shows/artist/phish.json?order_by=showdate&direction=desc&apikey=${
Deno.env.get("PHISH_NET_API_KEY")
const { data } = await axios.get(url);
const calendar = ical({ name: "Phish" });
const shows = data.data;
shows.forEach(show => {
const {
dhvanil avatar
val_AIvQijAexn
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_AIvQijAexn(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const calculateFactorial = (n) => {
if (n === 0 || n === 1) return 1;
let result = 1;
for (let i = 2; i <= n; i++) {
result *= i;
return result;
git avatar
sparkle
@git
An interactive, runnable TypeScript val by git
HTTP
export default async (request: Request): Promise<Response> => {
return new Response(
/* html */ `<html>
<head>
<script type="module" src="https://esm.sh/@stefanjudis/sparkly-text"></script>
</head>
<body style="max-height:600px;max-width:475px;background-color:#f0f0f0;">
<sparkly-text
number-of-sparkles="5"
style="--sparkly-text-size: 2.5em"
yieldray avatar
web
@yieldray
Debug ValTown's Web API
HTTP
# [Debug ValTown's Web API](https://yieldray-web.web.val.run)
export async function web(req: Request) {
return Response.json({
method: req.method,
url: req.url,
headers: Object.fromEntries(req.headers.entries()),
body: await req.text(),
dhvanil avatar
val_YZn5WPiaWB
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_YZn5WPiaWB(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const calculatePiDigits = (n) => {
const pi = Math.PI.toString().replace('.', '');
return pi.slice(0, n);
const checkPiAnomalies = (digits) => {
const piDigits = calculatePiDigits(digits);
const uniqueDigits = new Set(piDigits);
nbbaier avatar
getSiteMetadata
@nbbaier
An interactive, runnable TypeScript val by nbbaier
HTTP
export async function getUrlMetadata(url: string) {
try {
const metadata = await urlMetadata(url);
return metadata;
} catch (err) {
console.error("Error fetching metadata:", err);
return null;
const app = new Hono();
app.get("/", c => {
return c.json({ ok: true });
neverstew avatar
announcement
@neverstew
// Forked from @tmcw.htmlExample
Script
export const announcement = async (req: Request) => {
const { html } = await import("https://deno.land/x/html_escape/html.ts");
const params = new URL(req.url).searchParams;
const text = params.get("text") || "ANNOUNCEMENT";
return new Response(
html`
<html>
<style>
body {
display: flex;
dhvanil avatar
val_FjtKrDNgvP
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_FjtKrDNgvP(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const generateRandomNumbers = (count) => {
const numbers = [];
for (let i = 0; i < count; i++) {
numbers.push(Math.random());
return numbers;
const analyzeDistribution = (numbers) => {
dhvanil avatar
val_vuFskYdwPK
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_vuFskYdwPK(req) {
try {
// Execute the code directly and capture its result
const result = await (async () => {
const generateRandomNumbers = (n) => {
const numbers = [];
for (let i = 0; i < n; i++) {
numbers.push(Math.random());
return numbers;
const checkDistribution = (numbers) => {
taras avatar
scrape2md
@taras
This is a deno/valtown port in progress of https://github.com/tarasglek/scrape2md License: MIT Handy script to scrape various data sources into markdown. Intended to feed llms in https://chatcraft.org Usage: https://taras-scrape2md.web.val.run/ + URL_TO_SCRAPE Or just visit in browser and paste your url TODO https://chatcraft.org/api/share/tarasglek/IDYChVAilfePgVZb_T5pH POST from browser https://www.val.town/v/nbbaier/valToGH sync to github Metadata for use with https://github.com/tarasglek/valtown2js: { "typeCheck": false, "mappings": { "https://esm.sh/linkedom": { "name": "linkedom", "version": "^0.16.8" } }, "package": { "name": "scrape2md", "version": "1.0.0", "devDependencies": { "@types/turndown": "^5.0.4" } } }
HTTP
This is a deno/valtown port in progress of https://github.com/tarasglek/scrape2md
License: MIT
Handy script to scrape various data sources into markdown. Intended to feed llms in https://chatcraft.org
Usage:
https://taras-scrape2md.web.val.run/ + URL_TO_SCRAPE
Or just visit in browser and paste your url
function getYoutubeVideoID(url: URL): string | null {
const regExp = /(?:youtube\.com\/(?:[^/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/\s]{11})/i;
const match = url.href.match(regExp);
return match ? match[1] : null;
janpaul123 avatar
valle_tmp_275862191060511468456294552341596
@janpaul123
// This val will respond with a simple HTML page saying "Hello, world!"
HTTP
// This val will respond with a simple HTML page saying "Hello, world!"
export default async function main(): Promise<Response> {
const htmlContent = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello World</title>
<style>
body {
dhvanil avatar
val_4Etu5C04ol
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_4Etu5C04ol(req) {
try {
// Ensure request body is consumed
const body = await req.text();
// Create a function from the provided code and execute it
const userFunction = async () => {
const findPrimes = (n) => {
const primes = [];
for (let i = 2; i < n; i++) {
let isPrime = true;
vladimyr avatar
codeOnValTown_test
@vladimyr
// export default modifyFetchHandler(serveHtml, { val: { handle: author, name } });
HTTP
const { author, name } = extractValInfo(import.meta.url);
async function serveHtml(req: Request): Promise<Response> {
return new Response(
<html>
<head>
<title>test</title>
</head>
<body>
<p><code>@vladimyr/codeOnValTown modifyFetchHandler</code> test</p>
</body>
dhvanil avatar
val_6wxw8ODY78
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {
function fibonacci() {
let a = 0, b = 1;
while (b < 1000) {
let temp = b;
b = a + b;
a = temp;
return b;
bencmbrook avatar
pendoEnrichmentHandler
@bencmbrook
An interactive, runnable TypeScript val by bencmbrook
Script
export let pendoEnrichmentHandler = (req: express.Request, res: express.Response) => {
// Assumption for POC: Pendo `visitorId` = email address
const visitorId = req.body.coreIdentifier;
// Assumption for POC: Pendo `accountId` is always "Transcend-Demo-Account-Id"
const accountId = "Transcend-Demo-Account-Id";
res.json({
enrichedIdentifiers: {
accountId: [
value: accountId,
visitorId: [