234
235 try {
236 const response = await fetch("/", {
237 method: "POST",
238 body: JSON.stringify({
17}
18
19// Helper function to fetch SVG and convert to base64
20async function fetchSVGAsBase64(url: string): Promise<string> {
21 const response = await fetch(url);
22 if (!response.ok) {
23 throw new Error(`Failed to fetch SVG: ${response.status} ${response.statusText}`);
24 }
25 const svgText = await response.text();
48
49 try {
50 // Fetch SVG from the specified URL
51 const svgDataUri = await fetchSVGAsBase64("https://alexwein-fabwbogglelike.web.val.run/?svg=1");
52
53 // Upload blob to Bluesky
40
41 useEffect(() => {
42 fetchTasks();
43 loadUserPreferences();
44 }, []);
72 }
73
74 async function fetchTasks() {
75 try {
76 const response = await fetch("/get-tasks");
77 const data = await response.json();
78 setTaskLists(data);
79 } catch (error) {
80 console.error("Error fetching tasks", error);
81 }
82 }
86
87 try {
88 const response = await fetch("/add-task", {
89 method: "POST",
90 headers: { "Content-Type": "application/json" },
107
108 try {
109 const response = await fetch("/move-task", {
110 method: "POST",
111 headers: { "Content-Type": "application/json" },
125 async function removeTask(taskId, column) {
126 try {
127 const response = await fetch("/delete-task", {
128 method: "POST",
129 headers: { "Content-Type": "application/json" },
142
143 try {
144 const response = await fetch("/move-task", {
145 method: "POST",
146 headers: { "Content-Type": "application/json" },
174 if (!editedTaskText.trim() || !taskBeingEdited) return;
175 try {
176 const response = await fetch("/update-task", {
177 method: "POST",
178 headers: { "Content-Type": "application/json" },
42
43 try {
44 const response = await fetch(`https://www.shovel.report/api/domains/${domain}`);
45 if (!response.ok) {
46 throw new Error(`HTTP error! status: ${response.status}`);
52 };
53 } catch (error) {
54 console.error("Error fetching technologies:", error);
55 return { services: [], social_media: {} };
56 }
143
144 // send the request to openai
145 const response = await fetch(openaiUrl, {
146 method: "POST",
147 body: JSON.stringify(body),
187
188 try {
189 const response = await fetch("/", {
190 method: "POST",
191 body: JSON.stringify({
27 const authHeader = req.headers.get("Proxy-Authorization") || req.headers.get("Authorization");
28 const token = authHeader ? parseBearerString(authHeader) : undefined;
29 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization: `Bearer ${token}` } });
30 if (!meRes.ok) {
31 return new Response("Unauthorized", { status: 401 });
63 });
64
65 const openAIRes = await fetch(url, {
66 method: req.method,
67 headers,
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const sendSMS = async ({
19
20 try {
21 const response = await fetch(`https://api.twilio.com/2010-04-01/Accounts/${accountSid}/Messages.json`, {
22 method: "POST",
23 headers: {
19 : Math.floor((Date.now() - 2 * 24 * 60 * 60 * 1000) / 1000);
20
21 // Fetch and log tweets
22 const response = await socialDataSearch(`${query} since_time:${timeFrame}`);
23 console.log("Response from socialDataSearch:", response);
6
7export type RequestHandler = (request: Request) => Promise<Response>;
8export type DataFetcher<T> = (request: Request) => Promise<T>;
9
10// export type DataRequest<T> = Request & { data: T };