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/$1?q=fetch&page=1021&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 13506 results for "fetch"(1215ms)

Storyweavermain.tsx1 match

@aioe0x417a•Updated 6 months ago
45 formData.append('previousStory', JSON.stringify(storyParts.parts));
46
47 const response = await fetch('/generate-story', {
48 method: 'POST',
49 body: formData

blob_adminmain.tsx23 matches

@emilo•Updated 6 months ago
234 const [isDragging, setIsDragging] = useState(false);
235
236 const fetchBlobs = useCallback(async () => {
237 setLoading(true);
238 try {
239 const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
240 const data = await response.json();
241 setBlobs(data);
242 } catch (error) {
243 console.error("Error fetching blobs:", error);
244 } finally {
245 setLoading(false);
248
249 useEffect(() => {
250 fetchBlobs();
251 }, [fetchBlobs]);
252
253 const handleSearch = (e) => {
264 setBlobContentLoading(true);
265 try {
266 const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
267 const content = await response.text();
268 setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
269 setEditContent(content);
270 } catch (error) {
271 console.error("Error fetching blob content:", error);
272 } finally {
273 setBlobContentLoading(false);
278 const handleSave = async () => {
279 try {
280 await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
281 method: "PUT",
282 body: editContent,
290 const handleDelete = async (key) => {
291 try {
292 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
293 setBlobs(blobs.filter(b => b.key !== key));
294 if (selectedBlob && selectedBlob.key === key) {
307 const key = `${searchPrefix}${file.name}`;
308 formData.append("key", encodeKey(key));
309 await fetch("/api/blob", { method: "POST", body: formData });
310 const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
311 setBlobs([newBlob, ...blobs]);
315 }
316 }
317 fetchBlobs();
318 };
319
329 try {
330 const fullKey = `${searchPrefix}${key}`;
331 await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
332 method: "PUT",
333 body: "",
344 const handleDownload = async (key) => {
345 try {
346 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
347 const blob = await response.blob();
348 const url = window.URL.createObjectURL(blob);
363 if (newKey && newKey !== oldKey) {
364 try {
365 const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
366 const content = await response.blob();
367 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
368 method: "PUT",
369 body: content,
370 });
371 await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
372 setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
373 if (selectedBlob && selectedBlob.key === oldKey) {
383 const newKey = `__public/${key}`;
384 try {
385 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
386 const content = await response.blob();
387 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
388 method: "PUT",
389 body: content,
390 });
391 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
392 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
393 if (selectedBlob && selectedBlob.key === key) {
402 const newKey = key.slice(9); // Remove "__public/" prefix
403 try {
404 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
405 const content = await response.blob();
406 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
407 method: "PUT",
408 body: content,
409 });
410 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
411 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
412 if (selectedBlob && selectedBlob.key === key) {
822});
823
824export default lastlogin((request: Request) => app.fetch(request));

sqlitemain.tsx2 matches

@Madlean•Updated 6 months ago
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {

decisiveRoseFelidaemain.tsx6 matches

@techMember•Updated 6 months ago
15
16 useEffect(() => {
17 async function fetchWeather() {
18 try {
19 const response = await fetch(
20 `https://api.open-meteo.com/v1/forecast?latitude=${location.latitude}&longitude=${location.longitude}&current_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m,weathercode`
21 );
24 setError('');
25 } catch (error) {
26 console.error("Weather fetch failed", error);
27 setError('Failed to fetch weather data');
28 }
29 }
30 fetchWeather();
31 }, [location]);
32
70
71 try {
72 const geoResponse = await fetch(
73 `https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(locationInput)}&count=1&language=en&format=json`
74 );

scarletSolemain.tsx2 matches

@temptemp•Updated 6 months ago
32 url: "https://d000d.com/e/pklnjh0gnnou",
33 };
34 const req = await fetch("http://turnstileTest.pythonanywhere.com/solve", {
35 method: "POST",
36 headers: { "Content-Type": "application/json" },
63 return c.json({ worked: true });
64});
65export default app.fetch;

switchExtractormain.tsx1 match

@temptemp•Updated 6 months ago
7 "rapid-cloud.tv": "https://rapid-cloud.co/js/player/prod/e6-player-v2-debug.min.js",
8};
9const req = await fetch(site["megacloud.tv"]);
10const str = await req.text();
11let m;

scraper_templatemain.tsx1 match

@dkinzer222•Updated 6 months ago
9 const variable: string = await blob.getJSON(blobKey) ?? "";
10
11 const response = await fetch(scrapeURL);
12 const body = await response.text();
13 const $ = cheerio.load(body);

sqlitemain.tsx2 matches

@dkinzer222•Updated 6 months ago
35
36async function execute(statement: InStatement): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
49
50async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
51 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
52 method: "POST",
53 headers: {

jsonpubmain.tsx2 matches

@yawnxyz•Updated 6 months ago
1007app.get("/", (c) => c.html(html));
1008
1009// Export app.fetch for Val Town, otherwise export app
1010export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;
1011

blob_adminmain.tsx22 matches

@steveVT•Updated 6 months ago
233 const [isDragging, setIsDragging] = useState(false);
234
235 const fetchBlobs = useCallback(async () => {
236 setLoading(true);
237 try {
238 const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
239 const data = await response.json();
240 setBlobs(data);
241 } catch (error) {
242 console.error("Error fetching blobs:", error);
243 } finally {
244 setLoading(false);
247
248 useEffect(() => {
249 fetchBlobs();
250 }, [fetchBlobs]);
251
252 const handleSearch = (e) => {
263 setBlobContentLoading(true);
264 try {
265 const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
266 const content = await response.text();
267 setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
268 setEditContent(content);
269 } catch (error) {
270 console.error("Error fetching blob content:", error);
271 } finally {
272 setBlobContentLoading(false);
277 const handleSave = async () => {
278 try {
279 await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
280 method: "PUT",
281 body: editContent,
289 const handleDelete = async (key) => {
290 try {
291 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
292 setBlobs(blobs.filter(b => b.key !== key));
293 if (selectedBlob && selectedBlob.key === key) {
306 const key = `${searchPrefix}${file.name}`;
307 formData.append("key", encodeKey(key));
308 await fetch("/api/blob", { method: "POST", body: formData });
309 const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
310 setBlobs([newBlob, ...blobs]);
314 }
315 }
316 fetchBlobs();
317 };
318
328 try {
329 const fullKey = `${searchPrefix}${key}`;
330 await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
331 method: "PUT",
332 body: "",
343 const handleDownload = async (key) => {
344 try {
345 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
346 const blob = await response.blob();
347 const url = window.URL.createObjectURL(blob);
362 if (newKey && newKey !== oldKey) {
363 try {
364 const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
365 const content = await response.blob();
366 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
367 method: "PUT",
368 body: content,
369 });
370 await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
371 setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
372 if (selectedBlob && selectedBlob.key === oldKey) {
382 const newKey = `__public/${key}`;
383 try {
384 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
385 const content = await response.blob();
386 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
387 method: "PUT",
388 body: content,
389 });
390 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
391 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
392 if (selectedBlob && selectedBlob.key === key) {
401 const newKey = key.slice(9); // Remove "__public/" prefix
402 try {
403 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
404 const content = await response.blob();
405 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
406 method: "PUT",
407 body: content,
408 });
409 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
410 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
411 if (selectedBlob && selectedBlob.key === key) {

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 3 days ago