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=1201&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 13565 results for "fetch"(1311ms)

OpenAImain.tsx1 match

@pomdtr•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.

exchangeRatemain.tsx2 matches

@frontsideair•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export async function exchangeRate() {
5 const cheerio = await import("npm:cheerio");
6 const page = await fetch(
7 "https://kur.doviz.com/serbest-piyasa/amerikan-dolari",
8 ).then((response) => response.text());

isMyWebsiteDownmain.tsx2 matches

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

email_docsmain.tsx1 match

@appan•Updated 1 year ago
61 attachments?: AttachmentData[];
62}) => {
63 let result = await fetch(
64 `${API_URL}/v1/email`,
65 {

fetchTextREADME.md1 match

@vladimyr•Updated 1 year ago
1Migrated from folder: a0_forks/fetchText

fetchJSONREADME.md1 match

@vladimyr•Updated 1 year ago
1Migrated from folder: a0_forks/fetchJSON

sslCertificatesmain.tsx1 match

@agmm•Updated 1 year ago
14export async function getCertificates(domain: string) {
15 const url = `https://crt.sh/json?q=${domain}`;
16 const response = await fetch(url);
17 const certificates: Certificate[] = await response.json();
18 const domains = [...new Set(certificates.map(el => el.common_name))];

fetch_exampleREADME.md1 match

@vladimyr•Updated 1 year ago
1Migrated from folder: a2_shared/fetch_example

fetchREADME.md2 matches

@vladimyr•Updated 1 year ago
1# Proxied fetch - https://docs.val.town/std/fetch
2
3Migrated from folder: a0_forks/fetch

insecureSSLCertExamplemain.tsx4 matches

@vladimyr•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
2
3const url = "https://assignment-api.uspto.gov/patent/basicSearch?query=1234567&fields=main&rows=20";
4const proxyURL = new URL("https://unsecure-fetch.val-town.workers.dev");
5proxyURL.searchParams.set("url", url);
6
7// console.debug("proxyUrl: %s", proxyURL);
8// ==> proxyUrl: https://unsecure-fetch.val-town.workers.dev/?url=https%3A%2F%2Fassignment-api.uspto.gov%2Fpatent%2FbasicSearch%3Fquery%3D1234567%26fields%3Dmain%26rows%3D20
9console.log(await fetchText(proxyURL.href));

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 3 days ago