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=696&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 8614 results for "fetch"(2107ms)

isMyWebsiteDownmain.tsx3 matches

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

notifyHackerNewsRepliesmain.tsx2 matches

@chet•Updated 1 year ago
1import { blob } from "https://esm.town/v/std/blob?v=11";
2import { email } from "https://esm.town/v/std/email?v=11";
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
4import { JSDOM } from "npm:jsdom";
5
8export default async function(interval: Interval) {
9 const url = "https://news.ycombinator.com/threads?id=" + username;
10 const html = await fetchText(url);
11
12 console.log("html", html.slice(0, 100));

atmos_washington_ssl_cert_errormain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { insecureFetch } from "https://esm.town/v/stevekrouse/insecureFetch";
2
3const url = "https://atmos.washington.edu/cgi-bin/uw.cgi?20240408";
4const data = await insecureFetch(url);
5const text = await data.text();
6console.log(text);

insecureSSLCertExamplemain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { insecureFetch } from "https://esm.town/v/stevekrouse/insecureFetch";
2
3const url = "https://assignment-api.uspto.gov/patent/basicSearch?query=1234567&fields=main&rows=20";
4const data = await insecureFetch(url);
5const text = await data.text();
6console.log(text);
1This is an example call of @stevekrouse/insecureFetch
2
3Migrated from folder: Archive/atmos_washington_ssl_cert_error

valtownByExamplemain.tsx1 match

@pomdtr•Updated 1 year ago
112});
113
114export default app.fetch;

insecureFetchREADME.md5 matches

@stevekrouse•Updated 1 year ago
1# Insecure SSL Cert Fetch
2
3This will be useful if you're getting a `invalid peer certificate: UnknownIssuer error`.
4
5If 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/
6
7```ts
8import { insecureFetch } from "https://esm.town/v/stevekrouse/insecureFetch";
9
10const url = "https://assignment-api.uspto.gov/patent/basicSearch?query=1234567&fields=main&rows=20";
11const data = await insecureFetch(url)
12const text = await data.text();
13console.log(text)
14```
15
16Migrated from folder: Archive/insecureFetch

openaiUploadFilemain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function openaiUploadFile({ key, data, purpose = "assistants" }: {
16 formData.append("purpose", purpose);
17 formData.append("file", file, "data.json");
18 let result = await fetch("https://api.openai.com/v1/files", {
19 method: "POST",
20 headers: {

BlueCardChangeDetectormain.tsx1 match

@wilhelm•Updated 1 year ago
7
8export default async function(interval: Interval) {
9 const page = await fetch(site).then(res => res.text());
10 const date = page.match(/Last updated: <time datetime="([^"]+)">/)?.[1].toString();
11 const lastChange = await blob.get(dateChangedKey).then(res => res?.text()).catch(() => "");

isMyWebsiteDownmain.tsx2 matches

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

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago