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?q=fetch&page=726&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 8778 results for "fetch"(2226ms)

dot_commain.tsx1 match

@horatiothomas•Updated 1 year ago
31 if (url.pathname === "/favicon.ico") return new Response(null, { status: 404 });
32 if (url.pathname !== "/")
33 return fetch(
34 `https://stevekrouse.github.io/${url.pathname}${url.search}`,
35 request as any as RequestInit,

dream_interpretermain.tsx4 matches

@horatiothomas•Updated 1 year ago
73
74 // Send the POST request
75 const response = await fetch("https://dreaminterpreteraibackend.com/dream", {
76 method: "POST",
77 headers: {
87 "Sec-Ch-Ua-Mobile": "?0",
88 "Sec-Ch-Ua-Platform": "\"macOS\"",
89 "Sec-Fetch-Dest": "empty",
90 "Sec-Fetch-Mode": "cors",
91 "Sec-Fetch-Site": "cross-site",
92 "Uid": randomUuid(),
93 "User-Agent":

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 },

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago