10 let reason: string;
11 try {
12 const res = await fetch(URL, { redirect: "follow" });
13 if (res.status !== 200) {
14 reason = `(status code: ${res.status})`;
16 }
17 } catch (e) {
18 reason = `couldn't fetch: ${e}`;
19 ok = false;
20 }
8 let reason: string;
9 try {
10 const res = await fetch(URL, { redirect: "follow" });
11 if (res.status !== 200) {
12 reason = `(status code: ${res.status})`;
14 }
15 } catch (e) {
16 reason = `couldn't fetch: ${e}`;
17 ok = false;
18 }
122};
123
124export type FetchAction = {
125 type: "run";
126 command: string;
139};
140
141export type Command = OpenAction | CopyAction | FetchAction | PushAction;
142export type View = List | Detail | Form;
143
1/** @jsxImportSource npm:hono@3/jsx */
2import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
3import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
4import { Hono } from "npm:hono";
5
50
51const app = new Hono();
52export default reloadOnSaveFetchMiddleware(counterTownMiddleware(app.fetch));
53app.get("/", async (c) => {
54 return c.html(
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3async function fetchPluginData(pluginId) {
4 const response = await fetch(`https://www.figma.com/api/plugins/${pluginId}/versions`);
5 if (!response.ok) {
6 throw new Error(`Failed to fetch data for plugin ${pluginId}: ${response.statusText}`);
7 }
8 const data = await response.json();
12export default async function(interval: Interval) {
13 try {
14 const microPlugin = await fetchPluginData("1349001943025285729");
15 const wireBoxPlugin = await fetchPluginData("764471577604277919");
16
17 await sqlite.execute(`
38});
39
40export default app.fetch;
5const app = createApp();
6
7export default passwordAuth(app.fetch, {
8 verifyPassword: verifyToken,
9});
11
12 const srcURL = new URL(target);
13 const resp = await fetch(srcURL);
14 if (!resp.ok) {
15 return new Response("not found", { status: 404 });
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export async function getUltimesNoticies() {
5 const fetchResponse = await fetch(
6 "https://www.ccma.cat/324/ultimes-noticies/",
7 );
8 const responseText = await fetchResponse.text();
9 const now = new Date();
10 await email({
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));