4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({
8 limit: "10",
7 isInterval?: boolean;
8}) =>
9 fetchJSON(`api.val.town/run/`, {
10 headers: {
11 accept: "*/*",
1export function myApi(name) {
2 return "hi " + name;
3}
3// Activity suggestions for when you're bored
4export let boredActivities = fetchJSON(
5 "https://www.boredapi.com/api/activity"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function tidbytDeviceInstallations({ deviceId, apiKey }: {
4 deviceId: string;
5 apiKey: string;
6}) {
7 return fetchJSON(
8 `https://api.tidbyt.com/v0/devices/${deviceId}/installations`,
9 {
10 headers: {
11 Authorization: `Bearer ${apiKey}`,
12 },
13 },
24}[]> {
25 const res = await fetchJSON(
26 "https://api.val.town/v1/me/references?" +
27 searchParams({
28 since: since?.toISOString(),
38 await new Promise<void>((resolve) => setTimeout(() => resolve(), 150));
39 }
40 const code = `await api(
41 @andreterron.paintGraffitiPixel,
42 ${Math.min(Math.floor(Math.random() * 64), 64)}, // x
1import { name as name2 } from "https://esm.town/v/wonday/name";
2
3export function myApi(name) {
4 return `hi ${name}! my name is ${name2}`;
5}
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 console.email("hello " + name);
3 return "hello " + name;