7
8export default async function(interval: Interval) {
9 const page = await fetch(site).then(res => res.text());
10 const date = page.match(/Last updated: <time datetime="([^"]+)">/)?.[1].toString();
11 const lastChange = await blob.get(dateChangedKey).then(res => res?.text()).catch(() => "");
22});
23
24export default app.fetch;
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export default async (URL) => {
7 let reason: string;
8 try {
9 const res = await fetch(URL);
10 if (res.status !== 200) {
11 reason = `(status code: ${res.status})`;
13 }
14 } catch (e) {
15 reason = `couldn't fetch: ${e}`;
16 ok = false;
17 }
83});
84
85export default app.fetch;
5
6const app = new Hono();
7export default app.fetch;
8app.get("/", async (c) => {
9 const description = c.req.query("description") || "On weekdays at noon";
15
16 while (true) {
17 const resp = await fetch(url);
18 if (!resp.ok) {
19 throw new Error(await resp.text());
32 return { data } as T;
33 }
34 const resp = await fetch(`${API_URL}${path}`, {
35 ...options,
36 headers: {
59});
60
61export default app.fetch;
60});
61
62export default app.fetch
4import process from "node:process";
5
6async function fetchCast({ fid, hash }: { fid: string; hash: string }) {
7 console.log("fetchCast", { fid, hash });
8 const res = await fetch(
9 `https://api.neynar.com/v2/farcaster/cast?identifier=${hash}&type=hash`,
10 {
34 };
35
36 const res = await fetch(`https://simple-api.glif.app`, {
37 method: "POST",
38 body: JSON.stringify(body),
76 };
77
78 console.log("postCast fetching...", url, cast);
79 const res = await fetch(url, options);
80 let json;
81 try {
152
153 const cast = data.castId;
154 const castText = await fetchCast(cast);
155 console.log({ cast, castText });
156 const inputs = [castText];
17});
18
19export default app.fetch;