1import { paginateAPI } from "https://esm.town/v/andreterron/paginateAPI";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3import process from "node:process";
4
12 },
13 };
14 const me = await fetchJSON(
15 "https://api.val.town/v1/me",
16 opts,
1import { fetch } from "https://esm.town/v/std/fetch";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export const citiBikeSpotChecker = async (req, res) => {
5 const { data } = await fetch(
6 "https://gbfs.citibikenyc.com/gbfs/en/station_status.json"
7 ).then((r) => r.json());
17 const {
18 data: { stations: stationInfo },
19 } = await fetchJSON(
20 "https://gbfs.citibikenyc.com/gbfs/en/station_information.json"
21 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub repos
4export let githubRepos = fetchJSON(
5 "https://api.github.com/users/stevekrouse/repos"
6);
1import { fetchCat } from "https://esm.town/v/cole/fetchCat";
2
3export let dailyCat = async () => {
4 const url = fetchCat();
5 const html = `Here's a random cat: <img src="${url}">`;
6 console.email({ html }, "random cat");
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let blocks = async (req, res) => {
23 }
24 }"
25 x-init="blocks = await (await fetch('https://storage.googleapis.com/bb-search-data/parsed/blocks-min.json')).json()"
26 >
27 <div class='grid gap-4 grid-cols-4 lg:grid-cols-8'>
51 </html>`);
52 }
53 const gistRes = await fetch(`https://api.github.com/gists/${id}`);
54 if (!gistRes.ok) {
55 return res.send("GitHub replied with a non-200 status.");
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function nominatimSearch(params: Search): Promise<Place[]> {
4 return fetchJSON(
5 "https://nominatim.openstreetmap.org/search?" +
6 new URLSearchParams({
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function valOutput(req: Request) {
10 const author = match[1];
11 const name = match[2];
12 const val = await fetchJSON(
13 `https://api.val.town/v1/alias/${author}/${name}`,
14 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2import { round } from "https://esm.town/v/stevekrouse/round";
3import { nominatimSearch } from "https://esm.town/v/stevekrouse/nominatimSearch";
16 console.log({ lat, lon, display_name });
17 let url = `https://opensky-network.org/api/states/all?${query}`;
18 let data = await fetchJSON(url);
19 return data?.states?.map((f) => ({
20 icao24: f[0],
1import { msDay } from "https://esm.town/v/stevekrouse/msDay";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4// deprecated in favor of @stevekrouse.openAQLocation
5export let aqiLocation = async ({ lat, lon }: { lat: number; lon: number }) => {
6 const { results } = fetchJSON(
7 "https://api.openaq.org/v2/locations?" +
8 new URLSearchParams({
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const keepCloudClassifierWarmV4 = async () => {
4 const imgDataUrl =
5 "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
6 const response = await fetch(
7 "https://kaicathy-cloudid.hf.space/run/predict",
8 {