36
37 const { Chess } = await import("https://esm.sh/chess.js@1.0.0-beta.8")
38 const position = (await fetch(`/game/${game_id}`).then(r => r.json())).fen
39 const thinking = document.querySelector("#thinking")
40 thinking.className = "transition-opacity opacity-0"
69 thinking.className = "transition-opacity opacity-100"
70
71 const response = fetch(`/game/${game_id}`, {
72 method: "POST",
73 body: JSON.stringify({ san: move.san }),
278})
279
280export default app.fetch
1/** @jsxImportSource npm:hono/jsx */
2import { fetch } from "https://esm.town/v/std/fetch";
3import { faker } from "npm:@faker-js/faker";
4import CryptoJS from "npm:crypto-js";
14 "sec-ch-ua-mobile": "?0",
15 "sec-ch-ua-platform": "\"Windows\"",
16 "sec-fetch-dest": "empty",
17 "sec-fetch-mode": "cors",
18 "sec-fetch-site": "same-origin",
19 "Referrer-Policy": "strict-origin-when-cross-origin",
20};
58}
59async function upload(formData: any, user: string) {
60 const _ = await fetch("https://workers.cloudflare.com/playground/api/worker", {
61 "headers": {
62 ...commonHeaders,
75app.get("/regUser", async (c) => {
76 const uuid = await uuidGen();
77 const uid = await fetch("https://workers.cloudflare.com/playground", {
78 "headers": {
79 "accept":
123 headers: {
124 "User-Agent": faker.internet.userAgent(),
125 "Sec-Fetch-Dest": "iframe",
126 "referer": "https://workers.cloudflare.com/",
127 "Cookie": `token=${token}`,
153 );
154});
155export default app.fetch;
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));
1Migrated from folder: tools/cfetch
95 const getVQD = async () => {
96 try {
97 const response = await fetch(STATUS_URL, {
98 headers: {
99 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.3",
102 });
103
104 console.log('VQD Fetch Headers:', Object.fromEntries(response.headers.entries()));
105 const newVQD = response.headers.get('x-vqd-4') || '';
106 console.log('Fetched VQD:', newVQD);
107 setVqd(newVQD);
108 return newVQD;
109 } catch (error) {
110 console.error('VQD Fetch Error:', error);
111 return '';
112 }
125 let currentVQD = vqd || await getVQD();
126
127 const response = await fetch(CHAT_URL, {
128 method: 'POST',
129 headers: {
381 if (request.url.includes('/api/status')) {
382 try {
383 const statusResponse = await fetch('https://duckduckgo.com/duckchat/v1/status', {
384 headers: {
385 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.3",
400 } catch (error) {
401 console.error('Status Proxy Error:', error);
402 return new Response(JSON.stringify({ error: 'Failed to fetch VQD' }), {
403 status: 500,
404 headers: {
413 try {
414 const requestBody = await request.json();
415 const chatResponse = await fetch('https://duckduckgo.com/duckchat/v1/chat', {
416 method: 'POST',
417 headers: {
35}
36
37// ----- fetch or read from file
38
39async function fetchOutages() {
40 const res = await fetch(OUTAGES_URL);
41 const json = await res.json();
42 return json as OutagesJson;
101export async function getOutages() {
102 // const outagesJson = await readOutages();
103 const outagesJson = await fetchOutages();
104
105 // Create check
10app.get("/", async (c) => c.html(await sqlite_admin_tables()));
11app.get("/:table", async (c) => c.html(await sqlite_admin_table(c.req.param("table"))));
12export default basicAuth(app.fetch, { verifyUser: (_, password) => verifyToken(password) });
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4function fetchRandomJoke() {
5 const response = fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;
14 start = performance.now();
15 try {
16 const res = await fetch(url);
17 end = performance.now();
18 status = res.status;
25 } catch (e) {
26 end = performance.now();
27 reason = `couldn't fetch: ${e}`;
28 ok = false;
29 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);
1// ... imports ...
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;