SimpleAudioPlayerPWAapp.tsx3 matches
60setError("");
6162const response = await fetch('/generate-speech', {
63method: 'POST',
64headers: { 'Content-Type': 'application/json' },
365});
366367self.addEventListener('fetch', (event) => {
368event.respondWith(
369caches.match(event.request).then((response) => {
370return response || fetch(event.request);
371})
372);
SimpleAudioPlayerPWAindex.ts3 matches
5758try {
59const response = await fetch('/generate-speech', {
60method: 'POST',
61headers: { 'Content-Type': 'application/json' },
295});
296297self.addEventListener('fetch', (event) => {
298event.respondWith(
299caches.match(event.request).then((response) => {
300return response || fetch(event.request);
301})
302);
SimpleAudioPlayerindex.ts3 matches
45if (!text.trim()) return;
4647const response = await fetch('/generate-speech', {
48method: 'POST',
49headers: { 'Content-Type': 'application/json' },
257});
258259self.addEventListener('fetch', (event) => {
260event.respondWith(
261caches.match(event.request).then((response) => {
262return response || fetch(event.request);
263})
264);
randomWikipediacron2 matches
23export default async function(interval: Interval) {
4// fetch random article from wikipedia api
5const randomArticle = await fetch(
6"https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&meta=&generator=random&formatversion=2&exsentences=1&explaintext=1&grnnamespace=0",
7);
cerebras_coderindex.ts1 match
181182try {
183const response = await fetch("/", {
184method: "POST",
185body: JSON.stringify({
89const app = new Hono();
10export default app.fetch;
1112const baseUrl = "https://spacex.page";
151152// TODO: refactor to notification sending func
153const res = await fetch(notificationUrl, {
154method: "POST",
155headers: { "Content-Type": "application/json" },
24});
2526// HTTP vals expect an exported "fetch handler"
27// This is how you "run the server" in Val Town with Hono
28export default app.fetch;
29
23const [runsResponse, setRunsResponse] = useState<RunsResponse>({ records: [] });
2425const fetchRuns = () => agent.com.atproto.repo
26.listRecords({ collection: "me.wilb.test.run", repo: session.did })
27.then(res => setRunsResponse(res.data as unknown as RunsResponse))
29const deleteRun = (rkey: string) => agent.com.atproto.repo
30.deleteRecord({ collection: "me.wilb.test.run", repo: session.did, rkey })
31.then(() => fetchRuns())
3233return (
39{session && <button
40type="button"
41onClick={fetchRuns}>
42Get my runs
43</button>}
337338useEffect(() => {
339async function fetchQuote() {
340try {
341let loadedFromUUID = false;
342if (uuid) {
343const response = await fetch(`https://bao-simplevalueapi.web.val.run/getValue?id=${uuid}`);
344const responseData = await response.json();
345368while (quote === "") {
369const randomId = Math.floor(Math.random() * quoteCount) + 1;
370const response = await fetch(`/quote?pageId=${randomId}`);
371const responseData = await response.json();
372if ((responseData?.quote?.length ?? 0) >= 70) {
387setQuoteAuthor(author);
388if (uuid) {
389const writeResult = await fetch("https://bao-simplevalueapi.web.val.run/setValue", {
390method: "POST",
391headers: {
408}
409} catch (error) {
410console.error("Failed to fetch quote:", error);
411setLoadingError(`${error}`);
412setIsLoading(false);
414}
415416fetchQuote();
417}, []);
418544545if (uuid && name) {
546await fetch("https://bao-simplevalueapi.web.val.run/addLog", {
547method: "POST",
548headers: {
560}
561if (!isMatch && uuid && name) {
562await fetch("https://bao-simplevalueapi.web.val.run/addLog", {
563method: "POST",
564headers: {
584appendToLocalStorage(cipher.original, quoteAuthor);
585if (uuid && name) {
586const writeResult = await fetch("https://bao-simplevalueapi.web.val.run/addLog", {
587method: "POST",
588headers: {
1211const databaseId = "16e2c190bff080fd9ea8d2a8c21548b0";
12121213// Use database query with filter instead of direct page fetch
1214const response = await fetch(`https://api.notion.com/v1/databases/${databaseId}/query`, {
1215method: "POST",
1216headers: {
12531254let keyword = "";
1255console.log(`Fetched ${data.results.length} pages from Notion API:`);
1256for (const page of data.results) {
1257// console.log("Checking page", page.properties.ID);