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=1321&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 14468 results for "fetch"(15766ms)

untitled_aquaQuailmain.tsx2 matches

@liflovs•Updated 1 year ago
13
14async function execute(statement: InStatement): Promise<ResultSet> {
15 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
16 method: "POST",
17 headers: {
27
28async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
29 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
30 method: "POST",
31 headers: {

databinREADME.md1 match

@jamiedubs•Updated 1 year ago
1a super simple JSON setter/getter using valtown blobs. use GET to fetch it, use POST to set it. expects the inbound data to be JSON for simplicity. use `?key=foobar` to specify different storage locations.
2
3set:

gsheet_callmain.tsx2 matches

@mattx•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const gsheet_call = async (service_account, sheet_id, method, action, data) => {
9 };
10 const token = await getToken(service_account, googleAuthOptions);
11 const result = fetchJSON(
12 `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
13 {

edit_redirect_examplemain.tsx1 match

@stevekrouse•Updated 1 year ago
5app.get("/", (c) => c.text("Hello world!"));
6app.get("/edit", (c) => editRedirect());
7export default app.fetch;

editRedirectREADME.md1 match

@stevekrouse•Updated 1 year ago
12app.get("/", (c) => c.text("Hello world!"));
13app.get("/edit", (c) => editRedirect());
14export default app.fetch;
15```
16

untitled_oliveLoonmain.tsx1 match

@serna•Updated 1 year ago
9app.get("/", async (c) => c.html(await sqlite_admin_tables()));
10app.get("/:table", async (c) => c.html(await sqlite_admin_table(c.req.param("table"))));
11export default basicAuth(app.fetch);

untitled_lavenderMitemain.tsx1 match

@hlobil•Updated 1 year ago
9app.get("/", async (c) => c.html(await sqlite_admin_tables()));
10app.get("/:table", async (c) => c.html(await sqlite_admin_table(c.req.param("table"))));
11export default basicAuth(app.fetch);

umbrellaRemindermain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import { nominatimSearch } from "https://esm.town/v/stevekrouse/nominatimSearch";
4import { weatherGovGrid } from "https://esm.town/v/stevekrouse/weatherGovGrid";
14 lon,
15 });
16 let { properties: { periods } } = await fetchJSON(
17 grid.forecastHourly,
18 );

githubEmojimain.tsx2 matches

@karfau•Updated 1 year ago
1import { GITHUB_EMOJIS } from "https://esm.town/v/karfau/GITHUB_EMOJIS";
2import { fetch } from "https://esm.town/v/std/fetch?v=4";
3
4export const isEmoji = (key: string) => Object.hasOwn(GITHUB_EMOJIS, key);
23 }
24 try {
25 return fetch(url);
26 } catch (error) {
27 console.error(req.url, nameFromURL, error);

nftImagemain.tsx2 matches

@jamiedubs•Updated 1 year ago
1import { fetchNftMetadata } from "https://esm.town/v/jamiedubs/nftMetadata";
2
3export const nftImage = async (req: Request) => {
7 const format = searchParams.get("format")?.toLowerCase() ?? "text";
8 console.log("nftImage", { contractAddress, tokenId });
9 const json = await fetchNftMetadata(contractAddress, tokenId);
10 console.log("nftMetadata response =>", json);
11 const imageUrl = json["metadata"] && json["metadata"]["image"];

testWeatherFetcher1 file match

@sjaskeprut•Updated 1 day ago

weatherFetcher1 file match

@sjaskeprut•Updated 1 day ago