58try {
59// Simulate volume boost
60const result = await fetch('/volume-boost', {
61method: 'POST',
62body: JSON.stringify({ amount: boostAmount })
75try {
76// Simulate price boost
77const result = await fetch('/price-boost', {
78method: 'POST',
79body: JSON.stringify({ amount: boostAmount })
56export default async function(interval: Interval) {
7const response = await fetch("https://www.sperrychalet.com/vacancy_s.html");
8const body = await response.text();
9const $ = cheerio.load(body);
30if (url.pathname === "/test.json") return Response.json({ ok: true });
31if (url.pathname !== "/")
32return fetch(
33`https://stevekrouse.github.io/${url.pathname}${url.search}`,
34request as any as RequestInit,
gsheet_call_loggedmain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23export const gsheet_call = async (service_account, sheet_id, method, action, data) => {
10const token = await getToken(service_account, googleAuthOptions);
11console.log(`https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`);
12const result = fetchJSON(
13`https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
14{
cryptoVolumeTraderAdvicemain.tsx6 matches
1718useEffect(() => {
19async function fetchCryptoData() {
20try {
21const priceResponse = await fetch('https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum,dogecoin&vs_currencies=usd&include_24hr_change=true');
22const priceData = await priceResponse.json();
2324const 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');
25const volumeData = await volumeResponse.json();
2652setRecommendations(processedRecommendations);
53} catch (error) {
54console.error("Failed to fetch crypto data", error);
55}
56}
5758fetchCryptoData();
59const interval = setInterval(fetchCryptoData, 60000); // Update every minute
60return () => clearInterval(interval);
61}, []);
ReminderAppmain.tsx10 matches
1819useEffect(() => {
20fetchReminders();
21}, []);
2223const fetchReminders = async () => {
24try {
25const response = await fetch('/reminders');
26const data = await response.json();
27setReminders(data);
28} catch (error) {
29console.error('Failed to fetch reminders', error);
30}
31};
34e.preventDefault();
35try {
36const response = await fetch('/reminders', {
37method: 'POST',
38headers: { 'Content-Type': 'application/json' },
40});
41if (response.ok) {
42fetchReminders();
43setNewReminder({
44title: '',
57const toggleCompletion = async (id, currentStatus) => {
58try {
59const response = await fetch(`/reminders/${id}/toggle`, {
60method: 'PATCH',
61headers: { 'Content-Type': 'application/json' },
63});
64if (response.ok) {
65fetchReminders();
66}
67} catch (error) {
72const deleteReminder = async (id) => {
73try {
74const response = await fetch(`/reminders/${id}`, { method: 'DELETE' });
75if (response.ok) {
76fetchReminders();
77}
78} catch (error) {
cerebras_codermain.tsx1 match
182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
searchWithSerpApimain.tsx1 match
2425try {
26const response = await fetch(url);
27if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
28
tenaciousCoffeeSpoonbillmain.tsx28 matches
19e.preventDefault();
20try {
21const response = await fetch("/register", {
22method: "POST",
23headers: { "Content-Type": "application/json" },
48setCurrentUser({ username: "admin", fullName: "Admin" });
49setView("admin-dashboard");
50await fetchUserRegistrationList();
51await fetchDateWiseAttendance(selectedDate);
52return;
53}
5455try {
56const response = await fetch("/login", {
57method: "POST",
58headers: { "Content-Type": "application/json" },
63setCurrentUser(result.user);
64setView("attendance");
65await fetchAttendanceList();
66await fetchMonthlyStats();
67} else {
68alert(result.message);
75const markAttendance = async (status) => {
76try {
77const response = await fetch("/mark-attendance", {
78method: "POST",
79headers: { "Content-Type": "application/json" },
87const result = await response.json();
88if (result.success) {
89await fetchAttendanceList();
90await fetchMonthlyStats();
91alert(`Attendance marked as ${status}`);
92} else {
98};
99100const fetchAttendanceList = async () => {
101try {
102const response = await fetch("/attendance-list");
103const list = await response.json();
104setAttendanceList(list);
105} catch (error) {
106console.error("Failed to fetch attendance list");
107}
108};
109110const fetchMonthlyStats = async () => {
111try {
112const response = await fetch("/monthly-stats");
113const stats = await response.json();
114setMonthlyStats(stats);
115} catch (error) {
116console.error("Failed to fetch monthly stats");
117}
118};
119120const fetchUserRegistrationList = async () => {
121try {
122const response = await fetch("/user-registration-list");
123const list = await response.json();
124setUserRegistrationList(list);
125} catch (error) {
126console.error("Failed to fetch user registration list");
127}
128};
129130const fetchDateWiseAttendance = async (date) => {
131try {
132const response = await fetch(`/date-wise-attendance?date=${date}`);
133const list = await response.json();
134setDateWiseAttendance(list);
135} catch (error) {
136console.error("Failed to fetch date-wise attendance");
137}
138};
140const deleteUser = async (username) => {
141try {
142const response = await fetch("/delete-user", {
143method: "POST",
144headers: { "Content-Type": "application/json" },
147const result = await response.json();
148if (result.success) {
149await fetchUserRegistrationList();
150alert("User deleted successfully");
151} else {
232onChange={(e) => {
233setSelectedDate(e.target.value);
234fetchDateWiseAttendance(e.target.value);
235}}
236style={{ marginBottom: "15px" }}
540}
541542// Fetch User Registration List
543if (request.url.includes("/user-registration-list")) {
544const result = await sqlite.execute(
554}
555556// Fetch Date-wise Attendance
557if (request.url.includes("/date-wise-attendance")) {
558const url = new URL(request.url);
572}
573574// Fetch Monthly Stats
575if (request.url.includes("/monthly-stats")) {
576const currentDate = new Date();
609}
610611// Fetch Attendance List
612if (request.url.includes("/attendance-list")) {
613const result = await sqlite.execute(
spotifyAPImain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
23export let spotifyAPI = ({token, endpoint, ...params}) => fetchJSON(
4`https://api.spotify.com/v1/${endpoint}?${new URLSearchParams(params)}`,
5{