githubGistsmain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23// GitHub gists
4export let githubGists = fetchJSON(
5"https://api.github.com/users/stevekrouse/gists",
6);
119function updateExistingCodes() {
120const category = document.getElementById('filterCategory').value;
121fetch('/existing-qr-codes?category=' + encodeURIComponent(category))
122.then(response => response.json())
123.then(codes => {
205}
206207fetch('/generate', {
208method: 'POST',
209headers: {
nasaImageDetailsmain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
23export const nasaImageDetails = async () => {
4const nasaAPOD = await fetchJSON("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY");
5let nasaImageHtml = nasaAPOD.hdurl
6? `<img width="100%" src="${nasaAPOD.hdurl}"/>`
29setLoading(true);
30try {
31const response = await fetch("/generate", {
32method: "POST",
33headers: { "Content-Type": "application/json" },
multirouteHonomain.tsx1 match
108});
109110export default app.fetch;
111112const css = `
postmanClonemain.tsx3 matches
1/**
2* This val creates a Postman-like interface for testing HTTP requests directly in the browser.
3* It uses React for the UI and the Fetch API to make requests.
4* The server function serves the HTML and handles the API requests.
5*/
24body: method !== 'GET' && body ? body : undefined
25};
26const res = await fetch('/proxy', {
27method: 'POST',
28headers: { 'Content-Type': 'application/json' },
108const { url: targetUrl, options } = await request.json();
109try {
110const response = await fetch(targetUrl, options);
111const data = await response.json();
112return new Response(JSON.stringify({
niceTodoListmain.tsx1 match
43}
4445// Fetch todos from the database
46const todos = await sqlite.execute(`SELECT * FROM ${KEY}_todos_${SCHEMA_VERSION} ORDER BY id DESC`);
47
multiplayerCirclesmain.tsx2 matches
86const y = d3.select(this).attr("cy");
8788fetch(`/update?x=${x}&y=${y}&i=${d3.select(this).attr("idx")}`, { method: "post" });
89d3.select(this).attr("stroke", null);
90}
190return new Response(body, { headers: { "Content-Type": "text/event-stream" } });
191});
192export default app.fetch;
blob_adminmain.tsx2 matches
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
23import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138139export default modifyFetchHandler(passwordAuth(app.fetch));
getContentFromUrlmain.tsx16 matches
34};
3536console.log('[getJinaContent] Fetching:', fullUrl.toString(), headers);
3738try {
39const response = await fetch(fullUrl.toString(), {
40method: 'GET',
41headers: headers,
61}
62} catch (error) {
63console.error('Error fetching from Jina:', error);
64throw error;
65}
94};
9596console.log('[getFirecrawlContent] Fetching:', url, body);
9798try {
99const response = await fetch("https://api.firecrawl.dev/v0/scrape", {
100method: 'POST',
101headers: {
115return resultText;
116} catch (error) {
117console.error('Error fetching from Firecrawl:', error);
118throw error;
119}
129130let [response, metadata] = await Promise.all([
131fetch(url),
132getUrlMetadata(ogUrl)
133]);
182return output
183} catch (error) {
184console.error('Error fetching the URL:', error);
185return 'Error fetching the content: ', error.message || error || 'Unknown error.';
186}
187};
263};
264265const fetchMetadata = optsArray.includes('metadata') || optsArray.includes('doi') || optsArray.includes('citation');
266let metadata;
267268if (fetchMetadata) {
269metadata = await getUrlMetadata(ogUrl);
270}
275: await getJinaContent(serviceUrl, requestOptions);
276277if (fetchMetadata && !metadata) {
278const html = crawlMode === 'fire'
279? await getFirecrawlContent(serviceUrl, { returnFormat: 'html' })
336return output;
337} catch (error) {
338console.error('Error fetching the URL:', error);
339throw new Error('Error fetching the content: ' + error.message || error || 'Unknown error.');
340// return 'Error fetching the content: ' + error.message || error || 'Unknown error.';
341}
342};
475476477export default app.fetch;
478