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/image-url.jpg?q=fetch&page=719&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 8879 results for "fetch"(3276ms)

latLngOfCitymain.tsx2 matches

@jdan•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
2import { load } from "npm:cheerio";
3
4export async function latLngOfCity(args: { cityName: string }) {
5 const { cityName } = args;
6 const html = await fetchText(
7 `https://en.wikipedia.org/wiki/${cityName}`,
8 );

isMyWebsiteDownmain.tsx3 matches

@tsevdos•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export default async () => {
8 let reason: string;
9 try {
10 const res = await fetch(URL);
11 if (res.status !== 200) {
12 reason = `(status code: ${res.status})`;
14 }
15 } catch (e) {
16 reason = `couldn't fetch: ${e}`;
17 ok = false;
18 }

BlueCardChangeDetectormain.tsx1 match

@callumrollo•Updated 1 year ago
7
8export default async function(interval: Interval) {
9 const page = await fetch(site).then(res => res.text());
10 const date = page.match(/Last updated: <time datetime="([^"]+)">/)?.[1].toString();
11 const lastChange = await blob.get(dateChangedKey).then(res => res?.text()).catch(() => "");

key_value_apimain.tsx1 match

@mjweaver01•Updated 1 year ago
22});
23
24export default app.fetch;

isMyWebsiteDownmain.tsx3 matches

@weaverwhale•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export default async (URL) => {
7 let reason: string;
8 try {
9 const res = await fetch(URL);
10 if (res.status !== 200) {
11 reason = `(status code: ${res.status})`;
13 }
14 } catch (e) {
15 reason = `couldn't fetch: ${e}`;
16 ok = false;
17 }

calorieappmain.tsx1 match

@stevekrouse•Updated 1 year ago
83});
84
85export default app.fetch;

cron2main.tsx1 match

@stevekrouse•Updated 1 year ago
5
6const app = new Hono();
7export default app.fetch;
8app.get("/", async (c) => {
9 const description = c.req.query("description") || "On weekdays at noon";

apimain.tsx2 matches

@weaverwhale•Updated 1 year ago
15
16 while (true) {
17 const resp = await fetch(url);
18 if (!resp.ok) {
19 throw new Error(await resp.text());
32 return { data } as T;
33 }
34 const resp = await fetch(`${API_URL}${path}`, {
35 ...options,
36 headers: {

poembuilder3main.tsx1 match

@stevekrouse•Updated 1 year ago
59});
60
61export default app.fetch;

poembuildermain.tsx1 match

@stevekrouse•Updated 1 year ago
60});
61
62export default app.fetch

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago