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%22Optional%20title%22?q=fetch&page=826&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 10107 results for "fetch"(1907ms)

isMyWebsiteDownmain.tsx3 matches

@thejian•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 }

staticChessmain.tsx2 matches

@wesleychiyoka•Updated 1 year ago
10
11 constructor() {}
12 async fetch(req: Request): Promise<Response> {
13 const gameInfo = parseURL(req.url);
14 if (gameInfo === undefined) {
211
212const sc = new StaticChess();
213export default sc.fetch.bind(sc);

maroonBadgermain.tsx2 matches

@masd1•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
2import { html, load } from "npm:cheerio";
3
4const htmlStr = await fetchText(
5 "https://archive.is/pPFRB",
6);

staticChessmain.tsx2 matches

@rickygrassmuck•Updated 1 year ago
10
11 constructor() {}
12 async fetch(req: Request): Promise<Response> {
13 const gameInfo = parseURL(req.url);
14 if (gameInfo === undefined) {
211
212const sc = new StaticChess();
213export default sc.fetch.bind(sc);

limit_model_forkmain.tsx2 matches

@std•Updated 1 year ago
24 const authHeader = req.headers.get("Proxy-Authorization") || req.headers.get("Authorization");
25 const token = authHeader ? parseBearerString(authHeader) : undefined;
26 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization: `Bearer ${token}` } });
27 if (!meRes.ok) {
28 return new Response("Unauthorized", { status: 401 });
46 headers.set("OpenAI-Organization", Deno.env.get("OPENAI_API_ORG"));
47
48 const openAIRes = await fetch(url, {
49 method: req.method,
50 headers,

tinygoHttpExampleREADME.md1 match

@maxm•Updated 1 year ago
16
17import { wasmHandler } from "https://esm.town/v/maxm/tinygoHttp";
18const resp = await fetch("https://maxm-wasmblobhost.web.val.run/jpxqvyy5tphiwehzklmioklpkpz4gpzs.wasm");
19const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
20export default async function(req: Request): Promise<Response> {

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;

agentplex-deal-flow-email-fetch1 file match

@anandvc•Updated 2 days ago

proxyFetch2 file matches

@vidar•Updated 5 days ago