1/** @jsxImportSource npm:react **/
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
3import { load } from "npm:cheerio";
4import { renderToString } from "npm:react-dom@18/server";
5
6export default async (req: Request) => {
7 const html = await fetchText(
8 "https://www.moongiant.com/phase/today/",
9 );
3 */
4
5import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
6import { parse } from "npm:comment-parser";
7
19
20async function extractJSDocfromURL(url: string) {
21 const text = await fetchText(url);
22 return extractJSDocfromText(text);
23}
12 let reason: string;
13 try {
14 const res = await fetch(URL, { redirect: "follow" });
15 if (res.status !== 200) {
16 reason = `(status code: ${res.status})`;
18 }
19 } catch (e) {
20 reason = `couldn't fetch: ${e}`;
21 ok = false;
22 }
9console.log(dataURL1);
10
11const resp = await fetch(dataURL1);
12const text = await resp.text();
13console.assert(resp.headers.get("content-type") === "text/plain");
23});
24
25export default app.fetch;
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const gsheet_call = async (service_account, sheet_id, method, action, data) => {
9 };
10 const token = await getToken(service_account, googleAuthOptions);
11 const result = fetchJSON(
12 `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
13 {
78});
79
80export default app.fetch;
41 });
42 });
43 return app.fetch(req);
44});
1import { email } from "https://esm.town/v/std/email";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,
78});
79
80export default app.fetch;