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=1085&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 12407 results for "fetch"(1632ms)

list_newest_vals_actionmain.tsx2 matches

@pomdtr•Updated 1 year ago
1import { ListItem } from "https://esm.town/v/pomdtr/browser";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=44";
3
4export default async function() {
5 const { vals } = await fetchJSON("https://www.val.town/newest?page=0&_data=routes/_app.newest");
6
7 const items = vals.map(val => {

fetchJSONmain.tsx5 matches

@pomdtr•Updated 1 year ago
1import { normalizeURL } from "https://esm.town/v/stevekrouse/normalizeURL";
2
3export const fetchJSON = async (
4 url: string | URL,
5 options?: RequestInit & {
6 bearer?: string;
7 fetch?: typeof fetch;
8 },
9) => {
13 headers.set("authorization", `Bearer ${options.bearer}`);
14 }
15 let fetch = options?.fetch ?? globalThis.fetch;
16 let resp = await fetch(normalizeURL(url), {
17 redirect: "follow",
18 ...options,
24 }
25 catch (e) {
26 throw new Error(`fetchJSON error: ${e.message} in ${url}\n\n"${text}"`);
27 }
28};

amaranthYakmain.tsx3 matches

@stevekrouse•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
3import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
4import { sqlToCSV, sqlToJSON } from "https://esm.town/v/nbbaier/sqliteExportHelpers";
147});
148
149export const handler = app.fetch;
150
151export default modifyFetchHandler(passwordAuth(handler));

OpenAImain.tsx1 match

@pomdtr•Updated 1 year ago
12 * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
13 * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
14 * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
15 * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
16 * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.

exchangeRatemain.tsx2 matches

@frontsideair•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export async function exchangeRate() {
5 const cheerio = await import("npm:cheerio");
6 const page = await fetch(
7 "https://kur.doviz.com/serbest-piyasa/amerikan-dolari",
8 ).then((response) => response.text());

isMyWebsiteDownmain.tsx2 matches

@icy•Updated 1 year ago
10 let status: number;
11 try {
12 const res = await fetch(URL, { redirect: "follow" });
13 if (res.status !== 200) {
14 reason = `(status code: ${res.status})`;
17 }
18 } catch (e) {
19 reason = `couldn't fetch: ${e}`;
20 ok = false;
21 }

email_docsmain.tsx1 match

@appan•Updated 1 year ago
61 attachments?: AttachmentData[];
62}) => {
63 let result = await fetch(
64 `${API_URL}/v1/email`,
65 {

readabilityHTTPProxymain.tsx2 matches

@nbbaier•Updated 1 year ago
1import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
3import { html } from "https://esm.town/v/stevekrouse/html?v=5";
4import { Readability } from "npm:@mozilla/readability";
89 }
90
91 let body = await fetchText(articleUrl);
92
93 let doc = new JSDOM(body);

fetchTextREADME.md1 match

@vladimyr•Updated 1 year ago
1Migrated from folder: a0_forks/fetchText

fetchJSONREADME.md1 match

@vladimyr•Updated 1 year ago
1Migrated from folder: a0_forks/fetchJSON

fetch-socials4 file matches

@welson•Updated 1 day ago
fetch and archive my social posts

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 1 day ago