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=431&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 8384 results for "fetch"(1360ms)

58 try {
59 // Simulate volume boost
60 const result = await fetch('/volume-boost', {
61 method: 'POST',
62 body: JSON.stringify({ amount: boostAmount })
75 try {
76 // Simulate price boost
77 const result = await fetch('/price-boost', {
78 method: 'POST',
79 body: JSON.stringify({ amount: boostAmount })

spontaneousAmaranthFinchmain.tsx1 match

@mattrw2•Updated 3 months ago
5
6export default async function(interval: Interval) {
7 const response = await fetch("https://www.sperrychalet.com/vacancy_s.html");
8 const body = await response.text();
9 const $ = cheerio.load(body);

dotcommain.tsx1 match

@blotre•Updated 3 months ago
30 if (url.pathname === "/test.json") return Response.json({ ok: true });
31 if (url.pathname !== "/")
32 return fetch(
33 `https://stevekrouse.github.io/${url.pathname}${url.search}`,
34 request as any as RequestInit,

gsheet_call_loggedmain.tsx2 matches

@rochambeau314•Updated 3 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const gsheet_call = async (service_account, sheet_id, method, action, data) => {
10 const token = await getToken(service_account, googleAuthOptions);
11 console.log(`https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`);
12 const result = fetchJSON(
13 `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
14 {

cryptoVolumeTraderAdvicemain.tsx6 matches

@Sabji•Updated 3 months ago
17
18 useEffect(() => {
19 async function fetchCryptoData() {
20 try {
21 const priceResponse = await fetch('https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum,dogecoin&vs_currencies=usd&include_24hr_change=true');
22 const priceData = await priceResponse.json();
23
24 const volumeResponse = await fetch('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=bitcoin,ethereum,dogecoin&order=market_cap_desc&per_page=3&page=1&sparkline=false&price_change_percentage=24h');
25 const volumeData = await volumeResponse.json();
26
52 setRecommendations(processedRecommendations);
53 } catch (error) {
54 console.error("Failed to fetch crypto data", error);
55 }
56 }
57
58 fetchCryptoData();
59 const interval = setInterval(fetchCryptoData, 60000); // Update every minute
60 return () => clearInterval(interval);
61 }, []);

ReminderAppmain.tsx10 matches

@Azam123•Updated 3 months ago
18
19 useEffect(() => {
20 fetchReminders();
21 }, []);
22
23 const fetchReminders = async () => {
24 try {
25 const response = await fetch('/reminders');
26 const data = await response.json();
27 setReminders(data);
28 } catch (error) {
29 console.error('Failed to fetch reminders', error);
30 }
31 };
34 e.preventDefault();
35 try {
36 const response = await fetch('/reminders', {
37 method: 'POST',
38 headers: { 'Content-Type': 'application/json' },
40 });
41 if (response.ok) {
42 fetchReminders();
43 setNewReminder({
44 title: '',
57 const toggleCompletion = async (id, currentStatus) => {
58 try {
59 const response = await fetch(`/reminders/${id}/toggle`, {
60 method: 'PATCH',
61 headers: { 'Content-Type': 'application/json' },
63 });
64 if (response.ok) {
65 fetchReminders();
66 }
67 } catch (error) {
72 const deleteReminder = async (id) => {
73 try {
74 const response = await fetch(`/reminders/${id}`, { method: 'DELETE' });
75 if (response.ok) {
76 fetchReminders();
77 }
78 } catch (error) {

cerebras_codermain.tsx1 match

@muneeb683•Updated 3 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

searchWithSerpApimain.tsx1 match

@charmaine•Updated 3 months ago
24
25 try {
26 const response = await fetch(url);
27 if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
28

tenaciousCoffeeSpoonbillmain.tsx28 matches

@devansh_bansal•Updated 3 months ago
19 e.preventDefault();
20 try {
21 const response = await fetch("/register", {
22 method: "POST",
23 headers: { "Content-Type": "application/json" },
48 setCurrentUser({ username: "admin", fullName: "Admin" });
49 setView("admin-dashboard");
50 await fetchUserRegistrationList();
51 await fetchDateWiseAttendance(selectedDate);
52 return;
53 }
54
55 try {
56 const response = await fetch("/login", {
57 method: "POST",
58 headers: { "Content-Type": "application/json" },
63 setCurrentUser(result.user);
64 setView("attendance");
65 await fetchAttendanceList();
66 await fetchMonthlyStats();
67 } else {
68 alert(result.message);
75 const markAttendance = async (status) => {
76 try {
77 const response = await fetch("/mark-attendance", {
78 method: "POST",
79 headers: { "Content-Type": "application/json" },
87 const result = await response.json();
88 if (result.success) {
89 await fetchAttendanceList();
90 await fetchMonthlyStats();
91 alert(`Attendance marked as ${status}`);
92 } else {
98 };
99
100 const fetchAttendanceList = async () => {
101 try {
102 const response = await fetch("/attendance-list");
103 const list = await response.json();
104 setAttendanceList(list);
105 } catch (error) {
106 console.error("Failed to fetch attendance list");
107 }
108 };
109
110 const fetchMonthlyStats = async () => {
111 try {
112 const response = await fetch("/monthly-stats");
113 const stats = await response.json();
114 setMonthlyStats(stats);
115 } catch (error) {
116 console.error("Failed to fetch monthly stats");
117 }
118 };
119
120 const fetchUserRegistrationList = async () => {
121 try {
122 const response = await fetch("/user-registration-list");
123 const list = await response.json();
124 setUserRegistrationList(list);
125 } catch (error) {
126 console.error("Failed to fetch user registration list");
127 }
128 };
129
130 const fetchDateWiseAttendance = async (date) => {
131 try {
132 const response = await fetch(`/date-wise-attendance?date=${date}`);
133 const list = await response.json();
134 setDateWiseAttendance(list);
135 } catch (error) {
136 console.error("Failed to fetch date-wise attendance");
137 }
138 };
140 const deleteUser = async (username) => {
141 try {
142 const response = await fetch("/delete-user", {
143 method: "POST",
144 headers: { "Content-Type": "application/json" },
147 const result = await response.json();
148 if (result.success) {
149 await fetchUserRegistrationList();
150 alert("User deleted successfully");
151 } else {
232 onChange={(e) => {
233 setSelectedDate(e.target.value);
234 fetchDateWiseAttendance(e.target.value);
235 }}
236 style={{ marginBottom: "15px" }}
540 }
541
542 // Fetch User Registration List
543 if (request.url.includes("/user-registration-list")) {
544 const result = await sqlite.execute(
554 }
555
556 // Fetch Date-wise Attendance
557 if (request.url.includes("/date-wise-attendance")) {
558 const url = new URL(request.url);
572 }
573
574 // Fetch Monthly Stats
575 if (request.url.includes("/monthly-stats")) {
576 const currentDate = new Date();
609 }
610
611 // Fetch Attendance List
612 if (request.url.includes("/attendance-list")) {
613 const result = await sqlite.execute(

spotifyAPImain.tsx2 matches

@alexwein•Updated 3 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let spotifyAPI = ({token, endpoint, ...params}) => fetchJSON(
4 `https://api.spotify.com/v1/${endpoint}?${new URLSearchParams(params)}`,
5 {

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago