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/$2?q=fetch&page=1023&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 13469 results for "fetch"(6400ms)

redditNewmain.tsx3 matches

@alexdmejias•Updated 6 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2import { searchParams } from "https://esm.town/v/stevekrouse/searchParams";
3
4export const redditNew = async ({ r, before }: { r: string; before?: string }) => {
5 // const json = await fetchJSON(
6 // `https://www.reddit.com/r/${r}/new/.json?${await searchParams(
7 // { before },
8 // )}`,
9 // );
10 return fetchJSON(
11 `https://www.reddit.com/r/astoria.json`,
12 );

sqliteExplorerAppmain.tsx4 matches

@alexdmejias•Updated 6 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 })));

insightfulSalmonRabbitmain.tsx3 matches

@ubixsnow•Updated 6 months ago
45
46 try {
47 const response = await fetch("/summarize", {
48 method: "POST",
49 body: JSON.stringify({ url }),
145 const { url } = await request.json();
146
147 // Fetch webpage content
148 const webpageResponse = await fetch(url);
149 const webpageText = await webpageResponse.text();
150

bedtimeStoryMakermain.tsx1 match

@dependify•Updated 6 months ago
540);
541
542export default app.fetch;

Jokesmain.tsx4 matches

@kwc88•Updated 6 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;

Jokesmain.tsx4 matches

@shaniac6000•Updated 6 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;

ModuloCreazioneIntimitamain.tsx2 matches

@cicciocappa•Updated 6 months ago
11}
12
13// Sample questionnaire (can be expanded or fetched dynamically)
14const QUESTIONS: Question[] = [
15 {
406 const submitAnswers = async (submittedAnswers: Record<string, string>) => {
407 try {
408 const response = await fetch("/submit-questionnaire", {
409 method: "POST",
410 headers: {

Family100main.tsx11 matches

@nirwan•Updated 6 months ago
229 const [isLoading, setIsLoading] = useState(true);
230
231 // Fetch initial family tree data from server
232 useEffect(() => {
233 async function fetchFamilyTree() {
234 try {
235 const response = await fetch('/family-tree');
236 const data = await response.json();
237
253 setIsLoading(false);
254 } catch (error) {
255 console.error("Failed to fetch family tree", error);
256 setIsLoading(false);
257 }
258 }
259
260 fetchFamilyTree();
261 }, []);
262
271 try {
272 // Send new spouse data to server
273 const response = await fetch('/add-spouse', {
274 method: 'POST',
275 headers: {
309 try {
310 // Send new child data to server
311 const response = await fetch('/add-child', {
312 method: 'POST',
313 headers: {
342 try {
343 // Send updated name to server
344 const response = await fetch('/edit-node', {
345 method: 'POST',
346 headers: {
371 try {
372 // Send photo to server
373 const response = await fetch('/upload-photo', {
374 method: 'POST',
375 headers: {
399 try {
400 // Send spouse photo to server
401 const response = await fetch('/upload-spouse-photo', {
402 method: 'POST',
403 headers: {
533 const url = new URL(request.url);
534
535 // Fetch entire family tree
536 if (url.pathname === '/family-tree' && request.method === 'GET') {
537 try {

scrapeAndPreviewDelta8Productsmain.tsx1 match

@teretzdev•Updated 6 months ago
7export default async function scrapeProducts() {
8 try {
9 const response = await fetch("https://delta8pro.com/products/", {
10 headers: {
11 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'

scrapeProductsmain.tsx1 match

@teretzdev•Updated 6 months ago
7export default async function scrapeProducts() {
8 try {
9 const response = await fetch("https://delta8pro.com/products/", {
10 headers: {
11 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 3 days ago