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/$%7Bsuccess?q=fetch&page=694&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 8602 results for "fetch"(1923ms)

openaiUploadFilemain.tsx2 matches

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

valTownSearchREADME.md1 match

@pomdtr•Updated 1 year ago
5Either use the provided UI, or the query param:
6
7<https://val-town-search.pomdtr.me/search?q=fetchJSON>
8
9## How does it work ?

reading_and_writing_blobsmain.tsx1 match

@pomdtr•Updated 1 year ago
16
17// The lower level set and get can be used to store non-JSON or binary data.
18const resp = await fetch("https://picsum.photos/600/300");
19await blob.set("image", resp.body);
20const image = await blob.get("image");

amberBuzzardmain.tsx3 matches

@gacanu•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;

atmos_washington_ssl_cert_errormain.tsx2 matches

@eagereyes•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);
1This is an example call of @stevekrouse/insecureFetch

blueSwordfishmain.tsx2 matches

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

blueSwordfishREADME.md1 match

@stevekrouse•Updated 1 year ago
1This is an example call of @stevekrouse/insecureFetch
2
3Migrated from folder: Archive/blueSwordfish

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

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago