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=975&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 10193 results for "fetch"(1963ms)

quotemain.tsx2 matches

@nfelger•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let quote = (async () => {
4 const quotes = await fetchJSON(
5 "https://zenquotes.io/api/random/"
6 );

initialCommitmain.tsx3 matches

@jshawl•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let initialCommit = async (org, repo) => {
4 const repoData = await fetchJSON(
5 `https://api.github.com/repos/${org}/${repo}`
6 );
7 const { created_at } = repoData;
8 const until = new Date(Date.parse(created_at) + 600).toISOString();
9 const json = await fetchJSON(
10 `https://api.github.com/repos/${org}/${repo}/commits?until=${until}`
11 );

getUrlContentmain.tsx2 matches

@libo•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getUrlContent = (async () => {
6 );
7 const url = "https://blog.samaltman.com/how-to-be-successful";
8 const res = await fetch(
9 "https://extractus.deno.dev/extract?apikey=rn0wbHos2e73W6ghQf705bdF&type=article&url=" +
10 url

getPoolTimesmain.tsx2 matches

@briscoe•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const getPoolTimes = (async () => {
12 ];
13 const cheerio = await import("npm:cheerio");
14 const response = await fetch(
15 "https://www.swanleisure.ie/timetables?type=pool",
16 );

cityLookupmain.tsx2 matches

@rafter•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Cities named Brooklyn
4export let cityLookup = fetchJSON(
5 "https://nominatim.openstreetmap.org/search.php?city=brooklyn&format=jsonv2"
6);

elysiaExamplemain.tsx1 match

@tmcw•Updated 1 year ago
3 const app = new Elysia()
4 .get("/", () => "Hello Elysia");
5 return app.fetch(req);
6};

runsmain.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";
3
4export function runs({ token, error, source, since, until, offset, limit }: {
34 };
35}> {
36 return fetchJSON(
37 "https://api.val.town/v1/me/runs?" + searchParams({
38 error: error?.toString(),

mtmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import process from "node:process";
2import { basicAuthorization } from "https://esm.town/v/stevekrouse/basicAuthorization";
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
4
5/*
14*/
15export const mt = async (req, res) => {
16 const r = await fetchJSON(
17 "https://app.moderntreasury.com/api/user_onboardings",
18 {

bskyPostsmain.tsx2 matches

@sco•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Use this to get the Bluesky posts from any user.
4// Just pass in their username (like "vgr.bsky.social")
5export const bskyPosts = async (repo = "scottraymond.com") => {
6 const { records } = await fetchJSON(
7 `https://bsky.social/xrpc/com.atproto.repo.listRecords?repo=${repo}&collection=app.bsky.feed.post`
8 );

measureValTownE2emain.tsx3 matches

@dbcooper•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3// E.g. from a user's perspective (not the real execution time!)
8 for (let i = 0; i < count; i++) {
9 let start = Date.now();
10 await fetch("https://api.val.town/eval/(()=%3E1+1)()");
11 evalTimes.push(Date.now() - start);
12 }
23 for (let i = 0; i < count; i++) {
24 let start = Date.now();
25 await fetch("https://api.val.town/eval/@healeycodes.addOnes()");
26 userFuncTimes.push(Date.now() - start);
27 }

agentplex-deal-flow-email-fetch1 file match

@anandvc•Updated 4 days ago

proxyFetch2 file matches

@vidar•Updated 6 days ago