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=1093&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 12793 results for "fetch"(2625ms)

MapUsermain.tsx1 match

@iamseeley•Updated 1 year ago
22 });
23
24 fetch(`https://iamseeley-Map.web.val.run?city=${encodeURIComponent(city)}`)
25 .then(response => response.json())
26 .then(mapData => {

honoExamplemain.tsx1 match

@maxm•Updated 1 year ago
4app.get("/", (c) => c.text("Hello from Hono!"));
5app.get("/yeah", (c) => c.text("Routing!"));
6export default app.fetch;

staticChessmain.tsx2 matches

@avkv•Updated 1 year ago
10
11 constructor() {}
12 async fetch(req: Request): Promise<Response> {
13 if (new URL(req.url).pathname === "/robots.txt") {
14 return new Response("User-agent: *\nDisallow: /");
231const sc = new StaticChess();
232
233export default sc.fetch.bind(sc);

decorator_routermain.tsx1 match

@yieldray•Updated 1 year ago
10export const registered: Readonly<typeof _registered> = _registered;
11
12export const handler = (req: Request) => app.fetch(req);
13
14export interface Context {

staticChessV2main.tsx2 matches

@maxm•Updated 1 year ago
10
11 constructor() {}
12 async fetch(req: Request): Promise<Response> {
13 if (new URL(req.url).pathname === "/robots.txt") {
14 return new Response("User-agent: *\nDisallow: /");
224const sc = new StaticChess();
225
226export default sc.fetch.bind(sc);

markdown_downloadmain.tsx7 matches

@curtcox•Updated 1 year ago
114 }
115
116 const html = await fetch(url.toString(), {
117 method: req.method,
118 headers: new Headers({
121 "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
122 "Accept-Language": "en-US,en;q=0.5",
123 "Sec-Fetch-Site": "cross-site",
124 "Sec-Fetch-Mode": "navigate",
125 "Sec-Fetch-User": "?1",
126 "Sec-Fetch-Dest": "document",
127 "Referer": "https://www.google.com/",
128 "sec-ch-ua": `"Not A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"`,
145 transcript += arr.map(({ text }) => text).join("\n\n");
146 } catch (e) {
147 transcript = `Failed to fetch transcript ${e}\n`;
148 }
149 let header = "";
153 + y.description + "\n</div>\n\n";
154 } catch (e) {
155 header = `Failed to fetch youtube metadata: ${e}\n`;
156 }
157 markdown = header + "\n" + transcript;

MarkdownCommandmain.tsx1 match

@curtcox•Updated 1 year ago
7async function markdown(url: string) {
8 const encoded = encodeURIComponent(url);
9 const response = await fetch(`https://markdown.download/?url=${encoded}`);
10 return await response.text();
11}

valTownSearchmain.tsx1 match

@pomdtr•Updated 1 year ago
29 if (url.pathname == "/search") {
30 const query = url.searchParams.get("q");
31 const resp = await fetch(`https://api.github.com/search/code?q=${githubQuery(query)}`, {
32 headers: {
33 "Accept": "application/vnd.github.text-match+json",

weatherGPTmain.tsx1 match

@stevekrouse•Updated 1 year ago
4let location = "brooklyn ny";
5let lang = "en";
6const weather = await fetch(
7 `https://wttr.in/${location}?lang=${lang}&format=j1`,
8).then(r => r.json());

caloriesmain.tsx2 matches

@stevekrouse•Updated 1 year ago
6
7function esmTown(url) {
8 return fetch(url, {
9 headers: {
10 "User-Agent":
15
16const app = new Hono();
17export default app.fetch;
18
19app.get("/", async (c) =>

fetch-socials4 file matches

@welson•Updated 2 days ago
fetch and archive my social posts

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 2 days ago