1import { fetchPelotonData } from "https://esm.town/v/andreterron/fetchPelotonData";
2import { blob } from "https://esm.town/v/std/blob?v=3";
3import { rpc } from "https://esm.town/v/std/rpc";
11 }
12 if (!pelotonCache || Date.now() > pelotonCache.time + 8 * 60 * 1000) {
13 const value = await fetchPelotonData();
14 pelotonCache = {
15 value,
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function postHogAPICapture({ key, event, properties, distinct_id }: {
13 "distinct_id": distinct_id,
14 };
15 let result = await fetch("https://app.posthog.com/capture/", {
16 method: "POST",
17 headers: {
18 loadingDiv.style.display = 'block';
19
20 fetch(window.location.href, {
21 method: 'POST',
22 headers: {
96
97 // Send the POST request
98 const response = await fetch("https://dreaminterpreteraibackend.com/dream", {
99 method: "POST",
100 headers: {
110 "Sec-Ch-Ua-Mobile": "?0",
111 "Sec-Ch-Ua-Platform": "\"macOS\"",
112 "Sec-Fetch-Dest": "empty",
113 "Sec-Fetch-Mode": "cors",
114 "Sec-Fetch-Site": "cross-site",
115 "Uid": randomUuid(),
116 "User-Agent":
31 if (url.pathname === "/favicon.ico") return new Response(null, { status: 404 });
32 if (url.pathname !== "/")
33 return fetch(
34 `https://stevekrouse.github.io/${url.pathname}${url.search}`,
35 request as any as RequestInit,
73
74 // Send the POST request
75 const response = await fetch("https://dreaminterpreteraibackend.com/dream", {
76 method: "POST",
77 headers: {
87 "Sec-Ch-Ua-Mobile": "?0",
88 "Sec-Ch-Ua-Platform": "\"macOS\"",
89 "Sec-Fetch-Dest": "empty",
90 "Sec-Fetch-Mode": "cors",
91 "Sec-Fetch-Site": "cross-site",
92 "Uid": randomUuid(),
93 "User-Agent":
7
8async function renderImage(s: string, color: string) {
9 const fontArrayBuf = await fetch(
10 "https://cdn.jsdelivr.net/npm/roboto-font@0.1.0/fonts/Roboto/roboto-regular-webfont.ttf",
11 ).then((res) => res.arrayBuffer());
105});
106
107export default app.fetch;
63});
64
65export default app.fetch;
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export const webscrapeWikipediaIntro = (async () => {
4 const cheerio = await import("npm:cheerio");
5 const html = await fetchText(
6 "https://en.wikipedia.org/wiki/OpenAI",
7 );
1import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
2import { prettifyHtml } from "https://esm.town/v/neverstew/prettifyHtml";
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
4import { escape } from "npm:html-sloppy-escaper";
5
6export default modifyFetchHandler(async function(req: Request) {
7 const pathname = new URL(req.url).searchParams.get("url");
8 const html = await fetchText(pathname ?? "example.com"); // .then(prettifyHtml);
9 const body = `<html>
10 <head>
5 const search = `https://digitallibrary.un.org/search?p=${encodeURIComponent(symbol)}&rg=1&of=xm`;
6 try {
7 const response = await fetch(search);
8 const xmlData = await response.text();
9 const parser = new DOMParser();