1import { fetchFigmaFile } from "https://esm.town/v/rodrigotello/fetchFigmaFile";
2import { FigmaURLJSONexample } from "https://esm.town/v/rodrigotello/FigmaURLJSONexample";
3import process from "node:process";
6 const apiToken = process.env.myFigmaAPIToken;
7 const fileKey = FigmaURLJSONexample.key;
8 return fetchFigmaFile(apiToken, fileKey);
9})();
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2let { boredActivities } = await import("https://esm.town/v/valbee/boredActivities");
3
4export const imBored = async () => {
5 return (boredActivities = fetchJSON(
6 "https://www.boredapi.com/api/activity"
7 ));
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub followers
4export let githubFollowers = fetchJSON(
5 "https://api.github.com/users/stevekrouse/followers"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let homePage = async (req: express.Request, res: express.Response) => {
4 const p = await fetch("https://www.jeffreyhorn.com");
5 const html = await p.text();
6 res.type("html");
55 return c.json({ events });
56 });
57 return app.fetch(req);
58};
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Returns NASA's Astronomy Picture of the Day (APOD)
4export const nasaAPOD = fetchJSON("cutt.ly/T7ksirK");
5// Forked from @iBrokeit.nasaAPOD
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchImageAsBase64(url) {
4 const response = await fetch(url);
5 const blob = await response.blob();
6 return new Promise((resolve, reject) => {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function userVals({ token, id }: {
36 }
37 : {};
38 return fetchJSON(
39 `https://api.val.town/v1/users/${id}/vals`,
40 { headers },
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const dighimapperGcpCount = (async () => {
4 const url =
5 "https://annotations.allmaps.org/maps?imageservicedomain=images.dighimapper.eu";
6 const reponse = await fetch(url);
7 const annotations = await reponse.json();
8 let gcpCount = 0;
1import { fetchText } from "https://esm.town/v/mgruel/fetchText";
2
3export const fetchAndParseXML = async <T extends any = any>(
4 url: string | URL,
5 options?: RequestInit,
7 const { XMLParser } = await import("npm:fast-xml-parser");
8 const parser = new XMLParser();
9 const xmlString = await fetchText(url, options);
10 return parser.parse(xmlString) as T;
11};