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=276&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 3107 results for "fetch"(311ms)

test_explorermain.tsx1 match

@maxm•Updated 10 months ago
3export { Test } from "https://esm.town/v/pomdtr/test";
4
5export default router.fetch;

blobbyFacemain.tsx15 matches

@stevekrouse•Updated 10 months ago
2import { blobby } from "https://esm.town/v/yawnxyz/blobby";
3import { fileTypeFromBuffer } from 'npm:file-type';
4import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
5import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=74";
6
66
67
68// Endpoint to fetch blob by key
69app.get("/blob/:key", async (c) => {
70 const key = c.req.param('key');
193 this.blobs[key] = {isLoading: true};
194
195 const response = await fetch('/blob/' + key);
196 const contentType = response.headers.get('Content-Type');
197 blob.type = contentType || 'text/plain';
223 let blob = this.blobs[key];
224 try {
225 const response = await fetch('/create/' + key, {
226 method: 'POST',
227 headers: {
247
248 // Send a delete request to the server
249 const response = await fetch('/delete/' + key, { method: 'GET' });
250
251 // Check the response status
313
314 try {
315 const response = await fetch('/upload/' + key, {
316 method: 'POST',
317 body: formData,
338
339 try {
340 const response = await fetch('/uploadUrl' + '?key=' + key + '&url=' + url);
341
342 if (!response.ok) {
361 if (!this.newKeyName) return;
362 try {
363 const response = await fetch('/rename?key='+key+'&newKey='+this.newKeyName);
364 if (!response.ok) {
365 throw new Error('Failed to rename blob');
526 async loadBlob() {
527 this.isLoading = true;
528 const response = await fetch('/blob/' + this.key);
529 const contentType = response.headers.get('Content-Type');
530 this.blobType = contentType || 'text/plain';
550 async updateCreate() {
551 try {
552 const response = await fetch('/create/' + this.key, {
553 method: 'POST',
554 headers: {
573
574 try {
575 const response = await fetch('/upload/' + this.key, {
576 method: 'POST',
577 body: formData,
593 if (this.uploadUrl) {
594 try {
595 const response = await fetch('/uploadUrl?key=' + this.key + '&url=' + this.uploadUrl);
596
597 if (!response.ok) {
610 if (!this.newKeyName) return;
611 try {
612 const response = await fetch('/rename?key=' + this.key + '&newKey=' + this.newKeyName);
613 if (!response.ok) {
614 throw new Error('Failed to rename blob');
707
708
709// export default app.fetch;
710export default passwordAuth(app.fetch, {
711 // password: "123", // Deno.env.get("AUTH_TEST"),
712});

counterTownmain.tsx2 matches

@stevekrouse•Updated 10 months ago
1/** @jsxImportSource npm:hono@3/jsx */
2import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
3import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
4import { Hono } from "npm:hono";
5
50
51const app = new Hono();
52export default reloadOnSaveFetchMiddleware(counterTownMiddleware(app.fetch));
53app.get("/", async (c) => {
54 return c.html(

libsqlstudiomain.tsx1 match

@stevekrouse•Updated 10 months ago
4const app = createApp();
5
6export default lastlogin(app.fetch, {
7 verifyEmail: (email) => email === "steve@val.town",
8});

wikiOGmain.tsx2 matches

@stevekrouse•Updated 10 months ago
8
9 try {
10 const response = await fetch(apiUrl);
11 const data = await response.json();
12
20 };
21 } catch (error) {
22 console.error("Error fetching Wikipedia data:", error);
23 return null;
24 }

dnsmain.tsx1 match

@stevekrouse•Updated 10 months ago
4
5const app = new Hono();
6export default valTownBadgeMiddleware(app.fetch, import.meta.url);
7app.get("/", (c) => {
8 return c.html(

yellowSpidermain.tsx2 matches

@stevekrouse•Updated 10 months ago
1import { jsPython } from "npm:jspython-interpreter";
2const interpreter = jsPython()
3 .addFunction("fetch", fetch);
4const script = `
5 print(fetch("https://datasette.simonwillison.net/simonwillisonblog/blog_quotation.json?_labels=on&_shape=objects").text())
6`;
7await interpreter.evaluate(script);

blushAardwolfmain.tsx3 matches

@stevekrouse•Updated 10 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3const blog_bookmark = await fetchJSON(
4 "https://datasette.simonwillison.net/simonwillisonblog/blog_blogmark.json?_labels=on&_shape=objects",
5);
6
7const blog_quotation = await fetchJSON(
8 "https://datasette.simonwillison.net/simonwillisonblog/blog_quotation.json?_labels=on&_shape=objects",
9);

dateme_router_hydratedmain.tsx2 matches

@stevekrouse•Updated 10 months ago
10// Generic loader that forwards on requests for that page's JSON data
11function loader({ request }) {
12 return fetch(request, {
13 headers: {
14 "Content-Type": "application/json",
20function action({ request }) {
21 if (request.method === "GET") { throw Error("GET not expected here - something is wrong."); }
22 return fetch(request);
23}
24

dateme_home_reactmain.tsx1 match

@stevekrouse•Updated 10 months ago
14async function reverseGeocodeNominat(lat, lng) {
15 const url = `https://nominatim.openstreetmap.org/reverse?format=json&lat=${lat}&lon=${lng}&zoom=13`;
16 const response = await fetch(url);
17 const json = await response.json();
18 return json;

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago