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=706&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 8576 results for "fetch"(1400ms)

framemain.tsx2 matches

@nlnw•Updated 1 year ago
7
8async function renderImage(s: string, color: string) {
9 const fontArrayBuf = await fetch(
10 "https://cdn.jsdelivr.net/npm/roboto-font@0.1.0/fonts/Roboto/roboto-regular-webfont.ttf",
11 ).then((res) => res.arrayBuffer());
105});
106
107export default app.fetch;

pagemain.tsx1 match

@rwev•Updated 1 year ago
63});
64
65export default app.fetch;

webscrapeWikipediaIntromain.tsx2 matches

@richardkaplan•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export const webscrapeWikipediaIntro = (async () => {
4 const cheerio = await import("npm:cheerio");
5 const html = await fetchText(
6 "https://en.wikipedia.org/wiki/OpenAI",
7 );

viewSourcemain.tsx4 matches

@stevekrouse•Updated 1 year ago
1import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
2import { prettifyHtml } from "https://esm.town/v/neverstew/prettifyHtml";
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
4import { escape } from "npm:html-sloppy-escaper";
5
6export default modifyFetchHandler(async function(req: Request) {
7 const pathname = new URL(req.url).searchParams.get("url");
8 const html = await fetchText(pathname ?? "example.com"); // .then(prettifyHtml);
9 const body = `<html>
10 <head>

orangeAngelfishmain.tsx1 match

@wannli•Updated 1 year ago
5 const search = `https://digitallibrary.un.org/search?p=${encodeURIComponent(symbol)}&rg=1&of=xm`;
6 try {
7 const response = await fetch(search);
8 const xmlData = await response.text();
9 const parser = new DOMParser();

trpcmain.tsx2 matches

@pomdtr•Updated 1 year ago
5 const url = new URL(`${baseURL}/${procedure}`);
6 url.searchParams.set("input", JSON.stringify(input));
7 const resp = await fetch(url, {
8 headers: {
9 authorization: `Bearer ${Deno.env.get("valtown")}`,
17 },
18 async mutate<T = any>(procedure: string, input: Record<string, unknown>) {
19 const resp = await fetch(new URL(`${baseURL}/${procedure}`), {
20 method: "POST",
21 headers: {

isMyWebsiteDownmain.tsx2 matches

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

cdnmain.tsx3 matches

@pomdtr•Updated 1 year ago
5async function createScreenshot(code: string) {
6 const apiUrl = "https://sourcecodeshots.com/api/image";
7 const resp = await fetch(apiUrl, {
8 method: "POST",
9 headers: {
39 }
40 }
41 const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`, {
42 headers,
43 });
49 if (url.searchParams.has("v")) {
50 const version = url.searchParams.get("v");
51 const resp = await fetch(
52 `https://api.val.town/v1/vals/${val.id}/versions/${version}`,
53 { headers },

getValVersionmain.tsx2 matches

@pomdtr•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=43";
2
3console.log(
4 await fetchJSON(
5 `https://api.val.town/v1/vals/1f32d4c1-332e-4135-889f-8df408924a9d/versions/1`,
6 {

aliasValExamplemain.tsx2 matches

@pomdtr•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=43";
2
3console.log(await fetchJSON("https://api.val.town/v1/alias/stevekrouse/fetchJSON"));

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago