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=528&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 8496 results for "fetch"(964ms)

mightyAmberAlbatrossmain.tsx4 matches

@anniewong25•Updated 5 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;

dailyDadJokemain.tsx2 matches

@theswiftcoder•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,

cerebras_codermain.tsx1 match

@chabhishek420•Updated 5 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 5 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 5 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 5 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 5 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 5 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 5 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 5 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));

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago