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/$%7Bart_info.art.src%7D?q=fetch&page=693&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 8634 results for "fetch"(1795ms)

roseDragonmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function uploadTo0x0(data, name) {
6 formData.append("file", blob, name);
7 formData.append("expires", "1");
8 const response = await fetch("https://0x0.st", {
9 method: "POST",
10 body: formData,

fileInputUploadExamplemain.tsx1 match

@stevekrouse•Updated 1 year ago
16});
17
18export default app.fetch;

fileInputUploadExampleREADME.md1 match

@stevekrouse•Updated 1 year ago
7Currently (as of 4/14/24) this only works for small files (< 1mb). For larger files you get an error: `{"statusCode":413,"error":"Payload Too Large","message":"request entity too large"}`.
8
9A workaround is to upload to another service client-side, send the URL from that service to your Val Town server, and then fetch the file server-side (helper: @stevekrouse/uploadTo0x0).
10
11Migrated from folder: Archive/fileInputUploadExample

indielogin_examplemain.tsx2 matches

@pomdtr•Updated 1 year ago
45 });
46 }
47 const user = fetch("https://pomdtr-indielogin.web.val.run", {
48 method: "POST",
49 headers: {
61});
62
63export default app.fetch;

github_oauth_proxymain.tsx1 match

@pomdtr•Updated 1 year ago
7const app = new Hono();
8
9export default app.fetch;

viewSourcemain.tsx2 matches

@crif•Updated 1 year ago
1import { prettifyHtml } from "https://esm.town/v/neverstew/prettifyHtml";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
3import { escape } from "npm:html-sloppy-escaper";
4
5export default async function viewSource(req: Request) {
6 const pathname = new URL(req.url).pathname;
7 const html = await fetchText(
8 pathname === "/"
9 ? "https://www.flipkart.com/peter-england-analog-watch-men/p/itmabb4bc1893d05?pid=WATG6YGDUYAUEEMB&cmpid=product.share.pp&_refId=PP.d1a88903-d859-42ee-bc23-aad0425688fb.WATG6YGDUYAUEEMB&_appId=WA"

telemetrymain.tsx5 matches

@saolsen•Updated 1 year ago
466
467/**
468 * Wrapper for fetch that traces the request. It also passes a propagation header
469 * so if you are calling another val that uses traced_handler their traces will
470 * be tied together.
471 */
472export async function fetch(
473 input: string | URL,
474 init?: RequestInit,
475): Promise<Response> {
476 return await tracer().startActiveSpan(`fetch`, async (span) => {
477 const prop_output: { b3: string } = { b3: "" };
478 propagation.inject(context.active(), prop_output);
479 try {
480 const resp: Response = await globalThis.fetch(input, {
481 ...init,
482 headers: {
1248export async function traceViewer(req: Request): Promise<Response> {
1249 await migrate();
1250 return await app.fetch(req);
1251}
1252

telemetryREADME.md1 match

@saolsen•Updated 1 year ago
77```
78
79* `fetch` is a traced version of the builtin `fetch` function that traces the request. Just import it and use it like you would use `fetch`.
80
81* `sqlite` is a traced version of the val town sqlite client. Just import it and use it like you would use [https://www.val.town/v/std/sqlite](https://www.val.town/v/std/sqlite)

valwritermain.tsx6 matches

@yawnxyz•Updated 1 year ago
1/** @jsxImportSource npm:hono@3/jsx */
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
3import { chat } from "https://esm.town/v/stevekrouse/openai";
4import cronstrue from "npm:cronstrue";
17It stores each line of the poem in sqlite.
18It has a textbox that lets anyone input a new line to the poem.`,
19 content: await fetchText("https://esm.town/v/stevekrouse/poembuilder3?v=4"),
20 },
21 {
22 user: "an app that uses chatgpt to convert natural language to cron syntax",
23 content: await fetchText("https://esm.town/v/stevekrouse/cron2"),
24 },
25];
26
27const app = new Hono();
28export default app.fetch;
29app.get("/", async (c) => {
30 const example = examples[0] // examples[Math.floor(Math.random() * examples.length)];
74 You write Deno TypeScript.
75 Reply ONLY with valid Typescript.
76 Export the fetch function to run the server.
77 Only use web standard fetch. Export the fetch function to start the server.
78 Add extensive comments`,
79 },

PriestGPTmain.tsx1 match

@mjweaver01•Updated 1 year ago
66});
67
68export default app.fetch;

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago