1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23export let github = fetchJSON(
4"https://api.github.com/users/markthree"
5);
boredActivitiesmain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23// Activity suggestions for when you're bored
4export let boredActivities = fetchJSON(
5"https://www.boredapi.com/api/activity"
6);
test_concurrencyDoesntWorkmain.tsx17 matches
1import { fetch } from "https://esm.town/v/std/fetch";
23export const test_concurrencyDoesntWork = (async () => {
4const fetchDelayedResponse = async (index: number) => {
5const start = Date.now();
6const response = await fetch(
7"https://api.val.town/v1/express/alp.proxyFetch1",
8{
9method: "POST",
19);
20};
21const fetchDelayedResponseWithLoadBalancer = async (index: number) => {
22const start = Date.now();
23const response = await fetch(
24`https://api.val.town/v1/express/alp.proxyFetch${index}`,
25{
26method: "POST",
38console.log("w/o load balancer");
39await Promise.all([
40fetchDelayedResponse(1),
41fetchDelayedResponse(2),
42fetchDelayedResponse(3),
43fetchDelayedResponse(4),
44fetchDelayedResponse(5),
45]);
46console.log("w/ load balancer");
47await Promise.all([
48fetchDelayedResponseWithLoadBalancer(1),
49fetchDelayedResponseWithLoadBalancer(2),
50fetchDelayedResponseWithLoadBalancer(3),
51fetchDelayedResponseWithLoadBalancer(4),
52fetchDelayedResponseWithLoadBalancer(5),
53]);
54})();
peelSessionArtistmain.tsx2 matches
1import { fetchHtmlDom } from "https://esm.town/v/aeaton/fetchHtmlDom";
23export async function peelSessionArtist(url) {
4const dom = await fetchHtmlDom(url);
5const title = dom.querySelector("h3")?.textContent.trim();
6const bio = dom.querySelector("#bio1")?.textContent.trim();
githubEventsmain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23// GitHub events
4export let githubEvents = fetchJSON(
5"https://api.github.com/users/stevekrouse/events"
6);
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
23// Random math fact
4export let mathFact = fetchText(
5"http://numbersapi.com/random/math"
6);
fetchValTownAPImain.tsx3 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
23export async function fetchValTownAPI(
4apiToken: string,
5path: string,
12path = "/v1" + path;
13}
14return fetchJSON(`https://api.val.town${path}`, {
15...options,
16headers: {
elevenlabsTTSmain.tsx2 matches
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
314};
15const voiceId = "21m00Tcm4TlvDq8ikWAM"; // https://api.elevenlabs.io/v1/voices
16const audio = await fetch(
17`https://api.elevenlabs.io/v1/text-to-speech/${voiceId}`,
18{
dighimapperMultipleMapsmain.tsx2 matches
1import { fetch } from "https://esm.town/v/std/fetch";
23export const dighimapperMultipleMaps = (async () => {
4const url =
5"https://annotations.allmaps.org/maps?imageservicedomain=images.dighimapper.eu";
6const reponse = await fetch(url);
7const annotations = await reponse.json();
8let imageIds = new Set();
getMunichSwimCapacitmain.tsx7 matches
1import { fetch } from "https://esm.town/v/std/fetch";
23export async function getMunichSwimCapacit() {
21{ id: 30200, name: "Dantebad Sauna" },
22];
23async function fetchCount(id) {
24const endpoint =
25`https://functions.api.ticos-systems.cloud/api/gates/counter?organizationUnitIds=${id}`;
26const response = await fetch(endpoint, {
27headers: {
28"abp-tenantid": "69",
34"sec-ch-ua-mobile": "?0",
35"sec-ch-ua-platform": '"macOS"',
36"sec-fetch-dest": "empty",
37"sec-fetch-mode": "cors",
38"sec-fetch-site": "cross-site",
39},
40referrer: "https://www.swm.de/",
51async function populateUnits() {
52for (let unit of organizationUnitIds) {
53const populatedUnit = await fetchCount(unit.id);
54unit.personCount = populatedUnit.personCount;
55unit.maxPersonCount = populatedUnit.maxPersonCount;