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=577&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 7880 results for "fetch"(1562ms)

honoDatabricksU2MAuthmain.tsx1 match

@tfayyaz•Updated 10 months ago
38});
39
40export default app.fetch;

purpleQuokkamain.tsx1 match

@iamseeley•Updated 10 months ago
5const app = createApp();
6
7export default passwordAuth(app.fetch, {
8 verifyPassword: verifyToken,
9});

ejmmain.tsx1 match

@pomdtr•Updated 10 months ago
11
12 const srcURL = new URL(target);
13 const resp = await fetch(srcURL);
14 if (!resp.ok) {
15 return new Response("not found", { status: 404 });

getUltimesNoticiesmain.tsx3 matches

@icar•Updated 10 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export async function getUltimesNoticies() {
5 const fetchResponse = await fetch(
6 "https://www.ccma.cat/324/ultimes-noticies/",
7 );
8 const responseText = await fetchResponse.text();
9 const now = new Date();
10 await email({

sqliteExplorerAppmain.tsx4 matches

@hlobil•Updated 10 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 })));

SongTaggermain.tsx9 matches

@benlenarts•Updated 10 months ago
2import { home, scopesRoute } from "https://esm.town/v/hunty/spotify_helpers";
3import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
4import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
5import { querystring } from "https://esm.town/v/stevekrouse/querystring";
6import { thisWebURL } from "https://esm.town/v/stevekrouse/thisWebURL";
25
26export let spotifyRequestToken = ({ client_id, client_secret, code, redirect_uri }) =>
27 fetchJSON("https://accounts.spotify.com/api/token", {
28 method: "POST",
29 body: querystring({
39
40export let spotifyRefreshToken = async ({ refresh_token, client_id, client_secret }) =>
41 fetch("https://accounts.spotify.com/api/token", {
42 method: "POST",
43 body: new URLSearchParams({
193
194 try {
195 const currentlyPlaying = await fetch("https://api.spotify.com/v1/me/player/currently-playing", {
196 method: "GET",
197 headers: {
209
210 if (!mostRecentTrack) {
211 const recentTracks = await fetch("https://api.spotify.com/v1/me/player/recently-played", {
212 method: "GET",
213 headers: {
222 }
223 catch (e) {
224 return c.json({ error: "Fetch Error" + e });
225 }
226});
234
235 try {
236 const playStateResponse = await fetch("https://api.spotify.com/v1/me/player?market=US", {
237 method: "GET",
238 headers: {
253 }
254 catch (e) {
255 return c.json({ error: "Fetch Error" + e });
256 }
257});
258
259export default app.fetch;

sqliteExplorerAppmain.tsx4 matches

@burcs•Updated 10 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 })));

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 }

WebComponentExamplemain.tsx3 matches

@matthiasraimann•Updated 10 months ago
93
94 async handleSubmit(attend) {
95 return fetch('http://localhost:8080/events/register', {
96 method: 'POST',
97 body: JSON.stringify({
111
112 async updateAttendancy(attend) {
113 return fetch('http://localhost:8080/events/register', {
114 method: 'PUT',
115 body: JSON.stringify({
127
128 async getInitData() {
129 return fetch("http://localhost:8080/events/participants?" +
130 new URLSearchParams(
131 [

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago