Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Burl%7D?q=fetch&page=1082&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 13277 results for "fetch"(4835ms)

mortage_rate_drop_emailmain.tsx2 matches

@alm•Updated 9 months ago
9export default async function main(req: Request) {
10 try {
11 const response = await fetch(fredApiUrl);
12 const data = await response.json();
13
37 }
38 } catch (error) {
39 await email({ subject: "Error fetching mortgage rates", text: error.message });
40 }
41}

MuxAITranscriptmain.tsx1 match

@decepulis•Updated 9 months ago
71
72 const vttUrl = `https://stream.mux.com/${PLAYBACK_ID}/text/${TRACK_ID}.vtt`;
73 const vttResponse = await fetch(vttUrl);
74 const vttText = await vttResponse.text();
75

sqliteExplorerAppmain.tsx4 matches

@axelknock•Updated 9 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

gltf_torusmain.tsx1 match

@saolsen•Updated 9 months ago
226});
227
228export default app.fetch;

phpServemain.tsx1 match

@harveyfullstack•Updated 9 months ago
83 const form = event.target;
84 const formData = new FormData(form);
85 const response = await fetch('/api', {
86 method: 'POST',
87 headers: {

phpServemain.tsx1 match

@maxm•Updated 9 months ago
83 const form = event.target;
84 const formData = new FormData(form);
85 const response = await fetch('/api', {
86 method: 'POST',
87 headers: {

wikipediaTodaymain.tsx5 matches

@jamiedubs•Updated 9 months ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
2import { load } from "npm:cheerio";
3import { format } from "npm:date-fns";
44};
45
46const fetchAndParsePage = async (url: string) => {
47 const html = await fetchText(url);
48 const $ = load(html);
49
51 if (url == onThisDayUrl) {
52 // pull all <ul>'s out and combine together
53 // this is fetching all 3 major sections (Events, Births, Deaths) but I really only care about Events
54 parsedBody = $(".mw-content-ltr > ul").text();
55 // FIXME this isn't quite working but is what I want...
83 }
84
85 const data = await fetchAndParsePage(url);
86 if (format == "json") {
87 return Response.json({ data: data.split("\n") });

sqliteExplorerAppmain.tsx4 matches

@tempdev•Updated 9 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

validateUrlsInCsvmain.tsx3 matches

@alfred•Updated 9 months ago
1// This val provides an HTML interface for uploading a CSV file of URLs, validates them,
2// and returns a downloadable CSV file with the results.
3// It uses the Fetch API to check each URL's status and generates a CSV report.
4// We'll use the built-in URL constructor for basic URL validation and the native fetch for HTTP requests.
5// The UI is now styled using Tailwind CSS and shadcn UI components for a more polished look.
6// Added functionality to show the selected filename in the UI.
70 try {
71 new URL(url); // Basic URL validation
72 const response = await fetch(url, { method: "HEAD" });
73 return { url, valid: response.ok, status: response.status };
74 } catch {

arenaChannelContentsmain.tsx3 matches

@pomcute•Updated 9 months ago
1import { blob } from "https://esm.town/v/std/blob";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4const PAGE_SIZE = 50;
15 while (hasMore) {
16 const pagePromises = [];
17 for (let i = 0; i < 5 && hasMore; i++) { // Fetch 5 pages at a time
18 pagePromises.push(
19 fetch(`${baseUrl}?page=${currentPage + i}&per=${PAGE_SIZE}`)
20 .then(res => res.json()),
21 );

GithubPRFetcher

@andybak•Updated 13 hours ago

proxiedfetch1 file match

@jayden•Updated 1 day ago