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=983&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 10203 results for "fetch"(1862ms)

sendBulkVotemain.tsx2 matches

@pranjaldotdev•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3let { failureCount } = await import("https://esm.town/v/pranjaldotdev/failureCount");
11 const token =
12 "eyJhbGciOiJIUzI1NiJ9.eyJwbGF0Zm9ybSI6Imppb3Zvb3QiLCJ1c2VyaWR0eXBlIjoidXVpZCIsImlzSmlvVXNlciI6ZmFsc2UsImlzR3Vlc3QiOmZhbHNlLCJwaG9uZU5vIjoiMzM2NjBiNzQtM2U5YS00ZWJhLTlmMTMtNzBkNTQ3NmUwOTNkIiwicHJvZmlsZUlkIjoiMTE1ODc3YWQtZDE3Mi00YTAwLWI2OTMtMDlkZmNjNTEwOTMyIiwiaWF0IjoxNjg5NzA0MzA0LCJleHAiOjE2ODk3OTA3MDR9.ICKpSLJJexKR0wjDYDMpctvdTV33P0J6pxL3MAxWJyg";
13 const response = await fetch(votingURL, {
14 method: "POST",
15 headers: {

githubStarredmain.tsx2 matches

@rchasman•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub starred repos
4export let githubStarred = fetchJSON(
5 "https://api.github.com/users/stevekrouse/starred"
6);

githubUsermain.tsx2 matches

@mbforbes•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Github profile
4export let githubUser = fetchJSON(
5 "https://api.github.com/users/mbforbes"
6);

dlockmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { searchParams } from "https://esm.town/v/stevekrouse/searchParams";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import { parentReference } from "https://esm.town/v/stevekrouse/parentReference";
4
18 ttl = ttl ?? 3; // seconds
19 let method = release ? "release" : "acquire";
20 return fetchJSON(
21 `https://dlock.univalent.net/lock/${id}/${method}?${
22 searchParams({ ttl, lease })

evalPost2main.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let evalPost2 = fetchJSON(
4 "https://api.val.town/v1/eval",
5 {

hnPostsBymain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2import { HNcache } from "https://esm.town/v/stevekrouse/HNcache";
3import { hnPostIdsBy } from "https://esm.town/v/akkartik/hnPostIdsBy?v=3";
6 let postIds = await hnPostIdsBy(user);
7 return postIds.slice(0, 10).map(async (id) => {
8 HNcache[id] = await fetchJSON(
9 `https://hacker-news.firebaseio.com/v0/item/${id}.json`
10 );

allDateMeDocsLengthmain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
2import { dateMeProfiles } from "https://esm.town/v/stevekrouse/dateMeProfiles";
3
4// can only do first 100 because Val Town only allows 100 fetches per run
5export let allDateMeDocsLength =
6 (await Promise.all(
7 dateMeProfiles.slice(0, 100).map((p) =>
8 p.Profile?.at(0)?.href &&
9 fetchText(p.Profile[0].href).catch((e) => void 0)
10 ),
11 )).join("").length;

elysiamain.tsx1 match

@parweb•Updated 1 year ago
4 const app = new Elysia()
5 .get("/", () => items).post("/", () => items.push(Math.random()));
6 return app.fetch(req);
7};

pageIncludesmain.tsx2 matches

@glen•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let pageIncludes = async function (url, str) {
4 const f = await fetch(url);
5 const t = await f.text();
6 return t.includes(str);

reddit_matchesmain.tsx11 matches

@bnorick•Updated 1 year ago
6 filters,
7 current_state,
8 fetch_limit,
9 enable_toggle,
10 force,
15
16 // TODO: handle >10 subreddits by raising and exception?
17 let fetch_budget = Math.floor(fetch_limit / Object.keys(filters).length);
18 let additional_fetches_required = {};
19 let fetch_total = 0;
20
21 for (const subreddit in filters) {
44 filters: subreddit_filters,
45 after_utc: last_run_at_utc,
46 fetch_limit: fetch_budget,
47 });
48
49 fetch_total += result.fetches;
50
51 if (result.next_fetch_from) {
52 additional_fetches_required[subreddit] = result.next_fetch_from;
53 }
54
55 let extra_message = additional_fetches_required[subreddit]
56 ? `, reached fetch limit (${fetch_budget}), loading more posts after other subreddits if possible`
57 : "";
58 console.log(`processed ${result.new_posts} posts${extra_message}`);
66 }
67
68 // TODO: handle additional_fetches_required
69
70 let text = [];

agentplex-deal-flow-email-fetch1 file match

@anandvc•Updated 4 days ago

proxyFetch2 file matches

@vidar•Updated 6 days ago