markdown_downloadmain.tsx13 matches
145transcript += arr.map(({ text }) => text).join("\n\n");
146} catch (e) {
147transcript = `Failed to fetch transcript ${e}\n`;
148}
149let header = "";
153+ y.description + "\n</div>\n\n";
154} catch (e) {
155header = `Failed to fetch youtube metadata: ${e}\n`;
156}
157return header + "\n" + transcript;
203204let html = action.htmlContent;
205let fetch_response;
206if (!html) {
207fetch_response = await fetch(url.toString(), {
208method: req.method,
209headers: new Headers({
212"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
213"Accept-Language": "en-US,en;q=0.5",
214"Sec-Fetch-Site": "cross-site",
215"Sec-Fetch-Mode": "navigate",
216"Sec-Fetch-User": "?1",
217"Sec-Fetch-Dest": "document",
218"Referer": "https://www.google.com/",
219"sec-ch-ua": `"Not A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"`,
225});
226227console.log(fetch_response);
228229html = await fetch_response.text();
230}
231let title = "";
243let markdown_extended = markdown + "\n\n" + url;
244245if (fetch_response && Math.floor(fetch_response.status / 200) * 200 != 200 || markdown === "") {
246const jina_url = `https://r.jina.ai/${url.toString()}`;
247console.log(`jina fallback:${jina_url}`);
248const fallback_fetch_response = await fetch(jina_url);
249markdown_extended = await fallback_fetch_response.text();
250}
251if (req.headers.get("Accept")?.includes("text/html")) {
sqlite_adminmain.tsx1 match
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) });
wakatime-readme-chartmain.tsx4 matches
6869useEffect(() => {
70fetch("/chart")
71.then(response => response.text())
72.then(setChartUrl)
89}
9091async function fetchWakaTimeData(): Promise<DataPoint[]> {
92const response = await fetch("https://wakatime.com/share/@load1n9/899abefd-d814-4e99-b603-e94af0305d4a.json");
93const data = await response.json();
94return data.data.map((item: any) => ({
155if (url.pathname === "/chart") {
156try {
157const data = await fetchWakaTimeData();
158const chartBuffer = await generateChart(data);
159return new Response(chartBuffer, {
3export async function translate(req: Request) {
4if (req.method === "POST") {
5const { code: status, data } = await fetch("https://deepl.deno.dev/translate", {
6method: "POST",
7body: req.body,
35<script type="module">
36import { html, Component, render } from "https://cdn.cbd.int/htm/preact/standalone.module.js";
37import { ofetch } from "https://esm.sh/ofetch/dist/index.mjs";
38import { z } from "https://esm.sh/zod";
39// https://github.com/developit/htm
132target_lang: z.string().default("zh"),
133});
134const data = await ofetch("/", {
135method: "POST",
136body: Options.parse({
24}
2526async function fetchAndProcessData() {
27const response = await fetch(
28'https://api.npmjs.org/versions/xstate/last-week',
29)
145146if (await isTableEmpty()) {
147await fetchAndProcessData()
148}
149157export default async function cron(interval: Interval,): Promise<void> {
158await ensureTableExists()
159await fetchAndProcessData()
160}
161
selfDestructmain.tsx2 matches
1import ValTown from "https://esm.sh/@valtown/sdk@0.22.0";
2import { fetchValInfo } from "https://esm.town/v/pomdtr/fetchValInfo?v=2";
34export async function selfDestruct(importMetaUrl: string) {
5const { id } = await fetchValInfo(importMetaUrl);
6const { vals } = new ValTown();
7
18const getSpaces = async () => {
19const options = requestOptions({ method: "GET" });
20const response = await fetch(`${apiHost}/user/spaces`, options);
21const data = await response.json();
22const spaceNames = data.map(space => space.name);
10useEffect(() => {
11const checkAuth = async () => {
12const response = await fetch('/auth/check');
13const data = await response.json();
14setEmail(data.email);
strivingSilverTapirmain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23export const telegramGetMe = async (botToken: string) =>
4fetchJSON(
5`https://api.telegram.org/bot${botToken}/getMe`,
6);
telegramGetMemain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23export const telegramGetMe = async (botToken: string) =>
4fetchJSON(
5`https://api.telegram.org/bot${botToken}/getMe`,
6);