67 // Debug mode
68 if (mode === "debug") {
69 const response = await fetch(
70 `${baseUrl}?view=mTeam&view=mSettings&scoringPeriodId=2`,
71 {
112 `${baseUrl}?view=mMatchup&view=mMatchupScore&view=mTeam&view=mSettings&view=mBoxscore&view=mScoreboard&view=mRoster&view=mLiveScoring&scoringPeriodId=${targetWeek}`;
113
114 const response = await fetch(apiUrl, {
115 method: "GET",
116 headers: {
287 const apiUrl = `${baseUrl}?view=mTeam&view=mStandings&view=mSettings`;
288
289 const response = await fetch(apiUrl, {
290 method: "GET",
291 headers: {
353 `${baseUrl}?view=mRoster&view=mTeam&view=mLiveScoring&view=mMatchupScore&scoringPeriodId=${currentWeek}&teamId=${actualTeamId}`;
354
355 const response = await fetch(apiUrl, {
356 method: "GET",
357 headers: {
423 } catch (error) {
424 return Response.json({
425 error: "Failed to fetch fantasy data",
426 details: error.message,
427 });
13 console.log("📥 Incoming payload:", bodyText);
14
15 const resp = await fetch(APP_SCRIPT_URL, {
16 method: "POST",
17 headers: {
4
5async function main() {
6 const shader = await (await fetch(`${module_path}/shader.wgsl`)).text();
7
8 const adapter = await navigator.gpu?.requestAdapter();
1import { fetch } from "https://esm.town/v/std/fetch";
2
3const HF_TOKEN =
16 );
17
18 const jwtResponse = await fetch(
19 `https://huggingface.co/api/spaces/altox/asd/jwt?expiration=${expirationDate}&include_pro_status=true`,
20 {
30 console.log({ token });
31
32 // await fetch(
33 // "https://uptime.betterstack.com/api/v2/monitors/3276488",
34 // {
46 // );
47
48 const response = await fetch(
49 "https://uptime.betterstack.com/api/v2/monitors/3276488",
50 {
64app.get("/**/*", (c) => serveFile(c.req.path));
65
66export default app.fetch;
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({
13 });
14
15 // Fetch weather data for Madrid using Open-Meteo API
16 const weatherResponse = await fetch(
17 'https://api.open-meteo.com/v1/forecast?latitude=40.4168&longitude=-3.7038¤t=temperature_2m,weather_code,wind_speed_10m&timezone=Europe%2FMadrid'
18 );
19
20 if (!weatherResponse.ok) {
21 throw new Error('Failed to fetch weather data');
22 }
23
191<body style="font-family: sans-serif; text-align: center; padding: 50px; background: #f0f0f0;">
192 <h1>🌍 Weather Temporarily Unavailable</h1>
193 <p>Unable to fetch current weather data for Madrid. Please try again later.</p>
194 <p><em>Error: ${error instanceof Error ? error.message : 'Unknown error'}</em></p>
195</body>
22 // Use custom hooks for all stateful logic
23 const { userEmail, isAuthorized } = useAuth();
24 const { data, loading, error, refetch } = useGlimpseData(
25 glimpseId,
26 initialData,
107 <div className="flex gap-3">
108 <button
109 onClick={refetch}
110 className="bg-red-600 text-white px-4 py-2 rounded hover:bg-red-700 transition-colors"
111 >
71
72 // ---- Exchange JWT for access token ----
73 const tokenRes = await fetch("https://oauth2.googleapis.com/token", {
74 method: "POST",
75 headers: { "Content-Type": "application/x-www-form-urlencoded" },
89
90 // ---- Query Firestore publicLenses ----
91 const pubDocRes = await fetch(
92 `https://firestore.googleapis.com/v1/projects/${projectId}/databases/(default)/documents/publicLenses/${id}`,
93 { headers: { Authorization: `Bearer ${access_token}` } },
105
106 // ---- Query Firestore private user doc ----
107 const privDocRes = await fetch(
108 `https://firestore.googleapis.com/v1/projects/${projectId}/databases/(default)/documents/users/${owner}/lenses/${id}`,
109 { headers: { Authorization: `Bearer ${access_token}` } },
441 "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
442 },
443 "node-fetch": {
444 "version": "2.6.1",
445 "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
446 "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
447 },
623 "requires": {
624 "lodash": "4.17.13",
625 "node-fetch": "^2.6.0",
626 "request": "2.88.0"
627 }