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/$%7Burl%7D?q=fetch&page=1016&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 13582 results for "fetch"(3765ms)

renderHTMLWithHonomain.tsx1 match

@tristanmagne•Updated 6 months ago
61
62export default async function server(req: Request): Promise<Response> {
63 return app.fetch(req);
64}

sqliteExplorerAppmain.tsx4 matches

@mparker•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 })));

sharpCoralCoyotemain.tsx1 match

@tompatiger•Updated 6 months ago
5
6def get_quotes():
7 """Fetches quotes from Wikiquote."""
8
9 url = "https://en.wikiquote.org/wiki/Main_Page"

petunia_chatmain.tsx6 matches

@robertmccallnz•Updated 6 months ago
137
138 try {
139 const response = await fetch('/chat', {
140 method: 'POST',
141 headers: {
260 }
261
262 async function fetchMarketInsights() {
263 try {
264 const response = await fetch('/market-data', {
265 method: 'GET',
266 headers: { 'Accept': 'application/json' }
268
269 if (!response.ok) {
270 throw new Error('Failed to fetch market data');
271 }
272
298 }
299
300 refreshButton.addEventListener('click', fetchMarketInsights);
301 </script>
302 <footer>
368});
369
370export default app.fetch;

forEmulated1main.tsx1 match

@manyone•Updated 6 months ago
46 setIsRefining(isInitial ? false : true);
47 try {
48 const response = await fetch('/generate-landing-page', {
49 method: 'POST',
50 headers: {

LotecaV2main.tsx1 match

@maxm•Updated 6 months ago
62
63 try {
64 const resposta = await fetch(url);
65
66 if (!resposta.ok) {

md_links_resolvermain.tsx7 matches

@argimko•Updated 6 months ago
19 try {
20 isAutoProcessing.value = true;
21 const response = await fetch("/resolve-links", {
22 method: "POST",
23 headers: { "Content-Type": "application/json" },
350
351async function resolveRedirect(url: string): Promise<string> {
352 const fetchOptions = {
353 headers: {
354 "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",
357
358 try {
359 // Method 1: Fetch with manual redirect handling
360 try {
361 const response = await fetch(url, {
362 ...fetchOptions,
363 method: "HEAD",
364 redirect: "manual"
373 // Method 2: Full GET request for stubborn redirects
374 try {
375 const fullResponse = await fetch(url, {
376 ...fetchOptions,
377 method: "GET",
378 redirect: "follow"

versatileBlackKitemain.tsx3 matches

@eligosmlytics•Updated 6 months ago
25 const proxyImage = async (imageUrl: string, index: number) => {
26 try {
27 const response = await fetch(`/proxy-image?url=${encodeURIComponent(imageUrl)}`);
28 if (response.ok) {
29 const proxyUrl = await response.text();
222
223 try {
224 const imageResponse = await fetch(imageUrl, {
225 headers: {
226 'User-Agent': 'Mozilla/5.0',
230
231 if (!imageResponse.ok) {
232 return new Response('Image fetch failed', { status: imageResponse.status });
233 }
234

embedVideoWebPagemain.tsx4 matches

@eligosmlytics•Updated 6 months ago
26 const proxyImage = async (imageUrl: string, index: number) => {
27 try {
28 const response = await fetch(`/proxy-image?url=${encodeURIComponent(imageUrl)}`, {
29 headers: {
30 'Cache-Control': 'no-cache' // Ensure fresh fetch
31 }
32 });
233
234 try {
235 const imageResponse = await fetch(imageUrl, {
236 headers: {
237 'User-Agent': 'Mozilla/5.0',
242
243 if (!imageResponse.ok) {
244 return new Response('Image fetch failed', { status: imageResponse.status });
245 }
246

p5_latest_starterkitmain.tsx4 matches

@ff6347•Updated 6 months ago
5const getNpmTarball = async (scope, packageName, version = "latest") => {
6 const fullPackageName = scope ? `@${scope}/${packageName}` : packageName;
7 const response = await fetch(`https://registry.npmjs.org/${fullPackageName}/${version}`);
8
9 if (!response.ok) {
10 throw new Error(`Failed to fetch metadata for ${fullPackageName}`);
11 }
12
30 const zip = new JSZip();
31
32 // Fetch latest versions of modules from npm registry
33 const moduleContents = await Promise.all(
34 modules.map(async (moduleName) => {
42 const tarballUrl = await getNpmTarball(scope, packageName);
43
44 const tarballResponse = await fetch(tarballUrl);
45
46 if (!tarballResponse.ok) {

FetchBasic2 file matches

@ther•Updated 8 hours ago

GithubPRFetcher

@andybak•Updated 3 days ago