OpenTownieBranchSelect.tsx1 match
33return;
34}
35branches.refetch();
36if (res?.branch?.id) {
37navigate(`/chat/${projectId}/branch/${res.branch.id}`);
celestialBlushDuckmain.tsx2 matches
11Authorization: `Bearer ${authorization}`,
12};
13const res = await fetch(`${apiUrl}/linode/instances/${serverId}/reboot`);
14return res.ok;
15}
54});
5556export default app.fetch;
googleCalendarDayEndpointmain.tsx4 matches
1// This approach uses Google OAuth to authenticate the user and fetch their actual calendar events for the week.
2// It requires setting up OAuth credentials in the Google Cloud Console and configuring environment variables in Val Town.
34950// Exchange code for tokens
51const tokenResponse = await fetch("https://oauth2.googleapis.com/token", {
52method: "POST",
53headers: {
66const tokens = await tokenResponse.json();
6768// Fetch calendar events for this week
69const now = new Date();
70const oneWeekLater = new Date(now.getTime() + 24 * 60 * 60 * 1000);
7172const calendarResponse = await fetch(
73`https://www.googleapis.com/calendar/v3/calendars/primary/events?`
74+ `timeMin=${now.toISOString()}`
4export default async function(interval: Interval) {
5const key = "whgovwire_" + (new Date()).toISOString();
6const html = await fetch("https://www.whitehouse.gov/wire/").then(res => res.text());
7const $ = cheerio.load(html);
8
WebsiteFrontPageAlbummain.tsx2 matches
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
2import { DOMParser, type Element } from "jsr:@b-fuze/deno-dom";
353return;
54}
55fetchText(`https://ibb.co/album/${album}`).then(html =>
56resolve(Response.json(albumItems(html), cacheControl()))
57);
122return generatedData;
123} catch (error) {
124console.error("Error fetching or processing data from OpenAI:", error);
125console.warn("Using fallback race data due to the error.");
126// Ensure fallback data also has the hint, slice correctly
592errorInvalidFile: "Invalid file type. Please upload a PDF.",
593errorFileSize: "File is too large (Max {maxSize}).",
594errorFetchFailed: "Failed to perform analysis: {errorMessage}",
595// Contact Placeholders
596contactNamePlaceholder: "Your Name",
651errorInvalidFile: "Tipo de archivo inválido. Por favor, suba un PDF.",
652errorFileSize: "El archivo es demasiado grande (Máx {maxSize}).",
653errorFetchFailed: "Falló la realización del análisis: {errorMessage}",
654// Contact Placeholders
655contactNamePlaceholder: "Tu Nombre",
851852try {
853const response = await fetch(window.location.pathname + '?format=json', { method: 'POST', headers: { 'Accept': 'application/json'}, body: formData });
854updateLoadingProgress(25, 'loadingStatusAnalysis'); // Adjusted percentage
855const data = await response.json();
884} catch (error) {
885console.error('Analysis Request Error:', error);
886displayError('errorFetchFailed', { errorMessage: error.message });
887resultsContent.style.display = 'none'; // Ensure results area hidden on error
888noResultsMessage.style.display = 'block';
918const { OpenAI } = await import("https://esm.town/v/std/openai");
919const { z } = await import("npm:zod");
920const { fetch } = await import("https://esm.town/v/std/fetch");
921const { PDFExtract, PDFExtractOptions } = await import("npm:pdf.js-extract");
9221001try {
1002log.push({ agent, type: "step", message: `Workspaceing: ${url}` });
1003const res = await fetch(url, {
1004headers: { "User-Agent": "ValTownPolicyAnalysisBot/1.0" },
1005redirect: "follow",
1074try {
1075if (!input.documentUrl.match(/^https?:\/\//i)) throw new Error("Invalid URL scheme.");
1076const res = await fetch(input.documentUrl, {
1077headers: { "Accept": "text/plain, text/html, application/pdf", "User-Agent": "ValTownPolicyAnalysisBot/1.0" },
1078redirect: "follow",
1091} else if (ct.includes("text/") || ct === "") {
1092const text = await res.text();
1093if (!text?.trim()) throw new Error("Fetched empty text.");
1094log.push({ agent: ingestAgent, type: "result", message: `Workspaceed ~${text.length} chars.` });
1095docText = text;
1096} else { throw new Error(`Unsupported content type: ${ct}`); }
1097} catch (e) {
1098log.push({ agent: ingestAgent, type: "error", message: `URL fetch/process failed: ${e.message}` });
1099docText = null;
1100}
whatDoYouThinkOfItSoFarmain.tsx2 matches
1import { email } from "https://esm.town/v/std/email";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
3import { type Document, DOMParser, type Node } from "jsr:@b-fuze/deno-dom";
44243export default (interval: Interval) => {
44fetchText(
45Deno.env.get("rubbish_url")
46).then(html => {