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=728&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 8819 results for "fetch"(1664ms)

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));

insecureSSLCertExampleREADME.md2 matches

@vladimyr•Updated 1 year ago
1# Insecure SSL Cert Fetch
2
3If you need to make a fetch request to a website with a dubious or non-standard SSL certificate, you can use this proxy we made on Cloudflare workers (which doesn't verify SSL certs): https://unsecure-fetch.val-town.workers.dev/
4
5Example usage below.

isR18MagzineDownmain.tsx2 matches

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

indigoMockingbirdmain.tsx4 matches

@tsoongg•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3const randomJoke = await fetchRandomJoke();
4const setup = randomJoke.setup;
5const punchline = randomJoke.punchline;
9 subject: setup,
10});
11// Fetches a random joke.
12async function fetchRandomJoke() {
13 const response = await fetch(
14 "https://official-joke-api.appspot.com/random_joke",
15 );

Jokemain.tsx4 matches

@zoeecheung•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

dateme_sqlitemain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import { getDocs } from "https://esm.town/v/stevekrouse/getSqliteDateMeDocs";
4import { thisWebURL } from "https://esm.town/v/stevekrouse/thisWebURL";
36export async function setupDatabase() {
37 await createTable();
38 const docs = await fetchJSON(thisWebURL());
39 return docs.map(args =>
40 sqlite.execute({

bronzeParrotfishmain.tsx3 matches

@shouryaravula19•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4function fetchRandomJoke() {
5 const SAMPLE_JOKE = {
6 "setup": "What do you call a group of disorganized cats?",
10}
11
12const randomJoke = fetchRandomJoke();
13const setup = randomJoke.setup;
14const punchline = randomJoke.punchline;

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago