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/?q=fetch&page=290&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 3148 results for "fetch"(770ms)

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

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: {

harlequinEmumain.tsx4 matches

@stevekrouse•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
15import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=70";
16import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
17import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
18import { Hono } from "npm:hono";
19import type { FC } from "npm:hono/jsx";
174});
175
176export const handler = app.fetch;
177export default iframeHandler(modifyFetchHandler(passwordAuth(handler)));

libraryThatNeedsValidationmain.tsx1 match

@maxm•Updated 1 year ago
1export const newClient = async (username: string, password: string): Client => {
2 const url = `https://${username}-userspaceauth.web.val.run/validate/${password}`;
3 let resp = await fetch(url);
4 if (resp.status !== 200) {
5 throw new Error("Invliad response. Have you set up your fork? https://www.val.town/v/maxm/userspaceauth/fork?");

salmonCrabmain.tsx4 matches

@stevekrouse•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
15import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=70";
16import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
17import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
18import { Hono } from "npm:hono";
19import type { FC } from "npm:hono/jsx";
174});
175
176export const handler = app.fetch;
177export default iframeHandler(modifyFetchHandler(passwordAuth(handler)));

userspaceAuthmain.tsx1 match

@maxm•Updated 1 year ago
99 return c.json(match, match ? 200 : 401);
100});
101export default app.fetch;
102
103// console.log(await opaque.getOpaqueConfig(opaque.OpaqueID.OPAQUE_P521).ake.generateAuthKeyPair());

slackBotExamplemain.tsx2 matches

@maxm•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const slackReplyToMessage = async (req: Request) => {
15 // Note: `body.event` has information about the event
16 // like the sender and the message text
17 const result = await fetchJSON(
18 "https://slack.com/api/chat.postMessage",
19 {

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago