keyboardNtfymain.tsx2 matches
36// 2️⃣ send to ntfy via the server‑side proxy
37try {
38const res = await fetch(`/${NTFY_TOPIC}`, {
39method: "POST",
40headers: { "Content-Type": "application/json" },
150};
151152const ntfyResponse = await fetch(ntfyUrl, {
153method: "POST",
154headers: { "Content-Type": "application/json" },
67const getTextFromUrl = async (url) => {
8const response = await fetch("https://r.jina.ai/"+url);
9const text = await response.text();
10return text;
44});
4546export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;
47
52useEffect(() => {
53if (!userId) return;
54const fetchData = async () => {
55setLoading(true);
56try {
59let gd = dg;
60try {
61const gr = await fetch("/api/characters");
62if (gr.ok) {
63const fg = await gr.json();
64if (Array.isArray(fg) && fg.length > 0) gd = fg;
65} else console.warn(`Global fetch fail: ${gr.status}`);
66} catch (e) {
67console.error("Err fetch global:", e);
68}
69setCharacters(gd);
70let pd = dp;
71try {
72const pr = await fetch(`/api/personal-characters?userId=${userId}`);
73if (pr.ok) {
74const fp = await pr.json();
75if (Array.isArray(fp) && fp.length > 0) pd = fp;
76} else console.warn(`Personal fetch fail: ${pr.status}`);
77} catch (e) {
78console.error("Err fetch personal:", e);
79}
80setPersonalCharacters(pd);
81} catch (e) {
82console.error("Err fetchData:", e);
83setCharacters([...CHARACTERS.map(c => ({ ...c }))]);
84setPersonalCharacters([...CHARACTERS.map(c => ({ ...c }))]);
87}
88};
89fetchData();
90}, [userId]);
91useEffect(() => {
160console.log("Attempting to save rankings...");
161162const globalUpdate = fetch("/api/update-rankings", {
163method: "POST",
164headers: { "Content-Type": "application/json" },
166body: JSON.stringify(updatedGlobalChars),
167});
168const personalUpdate = fetch("/api/update-personal-rankings", {
169method: "POST",
170headers: { "Content-Type": "application/json" },
16setError(null);
17try {
18const response = await fetch('/generate-character', { method: 'POST' });
19if (!response.ok) {
20throw new Error(`HTTP error! status: ${response.status}`);
githubNotificationmain.tsx2 matches
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
34export async function githubNotification({ lastRunAt }) {
5let events = (
6await fetchJSON(
7"https://api.github.com/users/worrydream/events",
8) || []
reactHonoStarterindex.ts2 matches
21});
2223// HTTP vals expect an exported "fetch handler"
24// This is how you "run the server" in Val Town with Hono
25export default app.fetch;
MyStevenssendDailyBrief.ts1 match
135const lastSunday = today.startOf("week").minus({ days: 1 });
136137// Fetch relevant memories using the utility function
138const memories = await getRelevantMemories();
139
myNewWebsiteindex.ts2 matches
21});
2223// HTTP vals expect an exported "fetch handler"
24// This is how you "run the server" in Val Town with Hono
25export default app.fetch;
1import { fetch } from "https://esm.town/v/std/fetch";
23export async function urlToMarkdown(url: string) {
4try {
5// Fetch the webpage content
6const response = await fetch(url);
7if (!response.ok) {
8throw new Error(`Failed to fetch URL: ${response.status} ${response.statusText}`);
9}
10
pondiversefetchCreations0 matches
1import { blob } from "https://esm.town/v/std/blob";
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
3import { TABLE_NAME } from "./updateTable";
45export default async function(req: Request): Promise<Response> {