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/?q=fetch&page=507&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 8234 results for "fetch"(1192ms)

sqlite_adminmain.tsx1 match

@bons•Updated 5 months ago
10app.get("/", async (c) => c.html(await sqlite_admin_tables()));
11app.get("/:table", async (c) => c.html(await sqlite_admin_table(c.req.param("table"))));
12export default basicAuth(app.fetch, { verifyUser: (_, password) => verifyToken(password) });

StripeCheckoutDemomain.tsx2 matches

@vawogbemi•Updated 5 months ago
250 e.preventDefault();
251 const finalAmount = showCustomAmount ? parseFloat(customAmount) : amount;
252 const response = await fetch("/create-checkout-session", {
253 method: "POST",
254 headers: { "Content-Type": "application/json" },
510 }
511
512 // Fetch all tips for the root endpoint
513 const allTips = await sqlite.execute(
514 `SELECT name, amount, comment, timestamp FROM ${KEY}_payments_${SCHEMA_VERSION} ORDER BY amount DESC`,

sqliteExplorerAppmain.tsx4 matches

@tay•Updated 5 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

cheerfulTanDeermain.tsx4 matches

@alexab123•Updated 5 months ago
6};
7
8// Fetches a random joke.
9async function fetchRandomJoke() {
10 const response = await fetch(
11 "https://official-joke-api.appspot.com/random_joke",
12 );
14}
15
16const randomJoke = await fetchRandomJoke();
17const setup = randomJoke.setup;
18const punchline = randomJoke.punchline;

umbrellaRemindermain.tsx2 matches

@mdgrech•Updated 5 months 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 );

industriousEmeraldWhippetmain.tsx4 matches

@sheepish•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

jokeGeneratorValmain.tsx4 matches

@naomizhang•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

harmoniousBlackStoatmain.tsx4 matches

@eddietheegg2•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4function fetchRandomJoke() {
5 const response = fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

api_v1main.tsx1 match

@maxharper26•Updated 5 months ago
2
3// Define the HTTP val function
4export default async function fetchReturns(request: Request): Promise<Response> {
5 const databaseUrl = Deno.env.get("db_key_val_format");
6 if (!databaseUrl) {

stirringVioletHookwormmain.tsx1 match

@ryan_alive•Updated 5 months ago
41 `https://api.twitter.com/2/tweets/search/recent?query=${encodedQuery}&start_time=${since}&tweet.fields=author_id&expansions=author_id`;
42
43 const response = await fetch(url, {
44 headers: {
45 Authorization: `Bearer ${TWITTER_BEARER_TOKEN}`,

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago