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=591&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 9127 results for "fetch"(931ms)

cerebras_codermain.tsx1 match

@chabhishek420•Updated 6 months ago
23
24 try {
25 const response = await fetch("/", {
26 method: "POST",
27 body: JSON.stringify({ prompt, currentCode: code }),

Attendencemain.tsx2 matches

@nirwan•Updated 6 months ago
167
168 try {
169 const response = await fetch('/submit-attendance', {
170 method: 'POST',
171 headers: {
373 const selectedDate = url.searchParams.get('date') || new Date().toISOString().split('T')[0];
374
375 // Fetch attendance records for the selected date
376 const attendanceRecords = await sqlite.execute(`
377 SELECT * FROM ${KEY}_attendance

sqlitemain.tsx2 matches

@markscrivo•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: {

tfidf_analyser_90s_versionmain.tsx2 matches

@mikehiggins•Updated 6 months ago
358 }
359
360 const analysisResponse = await fetch('/analyse', {
361 method: 'POST',
362 headers: {
504
505export default async function(request: Request): Promise<Response> {
506 return app.fetch(request);
507}

cerebras_codermain.tsx1 match

@zpankz•Updated 6 months ago
23
24 try {
25 const response = await fetch("/", {
26 method: "POST",
27 body: JSON.stringify({ prompt, currentCode: code }),

cekdatatruckmain.tsx13 matches

@nirwan•Updated 6 months ago
37 e.preventDefault();
38 try {
39 const response = await fetch("/api/vehicle", {
40 method: "POST",
41 headers: {
120
121 useEffect(() => {
122 fetchAllVehicles();
123 }, []);
124
125 const fetchAllVehicles = async () => {
126 const response = await fetch("/api/all-vehicles");
127 const data = await response.json();
128 setVehicles(data);
215 useEffect(() => {
216 if (selectedCompany) {
217 fetchVehicles(selectedCompany);
218 setShowVehicleList(true);
219 }
234 }, [showScanner]);
235
236 const fetchVehicles = async (company) => {
237 const response = await fetch(`/api/vehicles?company=${company}`);
238 const data = await response.json();
239 setVehicles(data);
240 };
241
242 const fetchAllVehicles = async () => {
243 const response = await fetch("/api/all-vehicles");
244 const data = await response.json();
245 return data;
265 const handleScanResult = async (decodedText) => {
266 try {
267 const allVehicles = await fetchAllVehicles();
268 const matchedVehicle = allVehicles.find(vehicle => vehicle.plateNumber === decodedText);
269
275 }
276 } catch (error) {
277 console.error("Error fetching vehicle data:", error);
278 setScanError("Error fetching vehicle data. Please try again.");
279 }
280 };
287 const handleVehicleAdded = () => {
288 setShowAddVehicleForm(false);
289 fetchVehicles(selectedCompany);
290 setShowVehicleList(true);
291 };

email_jokemain.tsx4 matches

@kswang06•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;

blob_adminmain.tsx2 matches

@danfishgold•Updated 6 months ago
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));

blobmain.tsx4 matches

@bons•Updated 6 months ago
82async function list(prefix?: string): Promise<{ key: string; size: number; lastModified: string }[]> {
83 let querystring = prefix ? `?prefix=${encodeURIComponent(prefix)}` : "";
84 const res = await fetch(`${API_URL}/v1/blob${querystring}`, {
85 headers: {
86 Authorization: `Bearer ${Deno.env.get("valtown")}`,
95
96async function delete_(key: string) {
97 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
98 method: "DELETE",
99 headers: {
108
109async function get(key: string) {
110 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
111 headers: {
112 Authorization: `Bearer ${Deno.env.get("valtown")}`,
124
125async function set(key: string, value: BodyInit) {
126 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
127 method: "POST",
128 headers: {

sqliteExplorerAppmain.tsx4 matches

@lecoto•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";
15import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
16import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
17import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
18import { Hono } from "npm:hono";
19import type { FC } from "npm:hono/jsx";
302});
303
304export const handler = app.fetch;
305export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

proxyFetch2 file matches

@vidar•Updated 14 hours ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 1 day ago