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%20%22Image%20title%22?q=fetch&page=716&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 8999 results for "fetch"(1751ms)

pushovermain.tsx2 matches

@harper•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3// Send a pushover message.
14 });
15
16 const response = await fetch("https://api.pushover.net/1/messages.json", {
17 method: "POST",
18 headers: {

ShopifyProductSearchmain.tsx3 matches

@harper•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function ShopifyProductSearch(brokerId, first = 20) {
226 try {
227 // Making the POST request
228 const response = await fetch(url, {
229 method: "POST",
230 headers: headers,
238 const products = results.data.shopProductSearch.nodes;
239
240 console.log(`Fetched ${products.length} products`);
241
242 const productDetails = products.map((product) => ({

OpenAImain.tsx1 match

@pattysi•Updated 1 year ago
12 * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
13 * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
14 * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
15 * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
16 * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.

bookmarkletsmain.tsx3 matches

@pomdtr•Updated 1 year ago
2import { api } from "https://esm.town/v/pomdtr/api";
3import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
4import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
5import { Hono } from "npm:hono";
6import { jsxRenderer } from "npm:hono/jsx-renderer";
10
11async function bookmarkletUrl(author: string, name: string) {
12 const resp = await fetch(`https://esm.town/v/${author}/${name}`);
13 const { code } = await minify(await resp.text());
14 return `javascript:(() => {${encodeURIComponent(code)}})()`;
96});
97
98export default app.fetch;

violetPerchmain.tsx2 matches

@andreterron•Updated 1 year ago
9 let reason: string;
10 try {
11 const res = await fetch(URL, { redirect: "follow" });
12 if (res.status !== 200) {
13 reason = `(status code: ${res.status})`;
15 }
16 } catch (e) {
17 reason = `couldn't fetch: ${e}`;
18 ok = false;
19 }

blob_adminmain.tsx1 match

@pomdtr•Updated 1 year ago
132});
133
134export default app.fetch;

gistsmain.tsx3 matches

@yieldray•Updated 1 year ago
3const USERNAME = "yieldray"; // <--- Replace with your Github username
4
5const gistList: Array<Gist> = await fetch(`https://api.github.com/users/${USERNAME}/gists`).then((res) => res.json());
6
7app.get("/", (req) => {
42 const f = gist.files[file];
43 if (!f) return new Response("404 File Not Found", { status: 404 });
44 const res = await fetch(f.raw_url);
45 const headers = new Headers(res.headers);
46 // delete unwanted header
61});
62
63const handler = app.fetch
64export default handler
65

cron_client_react_forkmain.tsx1 match

@stevekrouse•Updated 1 year ago
29 e.preventDefault();
30 setLoading(true);
31 const cron = await fetch("/compile", {
32 method: "POST",
33 body: new FormData(e.target as HTMLFormElement),

cron_client_side_script_forkmain.tsx2 matches

@stevekrouse•Updated 1 year ago
5
6const app = new Hono();
7export default app.fetch;
8app.get("/", (c) =>
9 c.html(
89 button.disabled = true;
90 button.innerText = "Loading..";
91 const cron = await fetch("/compile", { method: "POST", body: new FormData(form) }).then((r) => r.text());
92 button.disabled = false;
93 button.innerText = "Compile";

translatormain.tsx4 matches

@yawnxyz•Updated 1 year ago
189 const formData = new FormData();
190 formData.append("audio", blob, "recording.wav");
191 const response = await fetch("/transcribe", { method: "POST", body: formData });
192 if (response.ok) {
193 const result = await response.text();
229 const language2Value = document.getElementById("language2").value;
230
231 const response = await fetch("/translate", {
232 method: "POST",
233 headers: { "Content-Type": "application/json" },
271
272 if (text && voice) {
273 const response = await fetch('/generate-speech', {
274 method: 'POST',
275 headers: { 'Content-Type': 'application/json' },
401
402
403export default app.fetch;

TAC_FetchBasic2 file matches

@A7_OMC•Updated 6 hours ago

hn-fetch1 file match

@matija•Updated 8 hours ago