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";
2import process from "node:process";
3
4export async function githubNotifications() {
5 const res = await fetch("https://api.github.com/notifications?all=true", {
6 headers: {
7 Authorization: `Bearer ${process.env.GH_TOKEN}`,
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const nearestOpenStation = async ({ lon, lat }) => {
13 const {
14 data: { stations: stationInfo },
15 } = await fetch(
16 `https://gbfs.${gbfsDomain}/gbfs/en/station_status.json`
17 ).then((r) => r.json());
23 const {
24 data: { stations },
25 } = await fetch(
26 `https://gbfs.${gbfsDomain}/gbfs/en/station_information.json`
27 ).then((r) => r.json());
1import { fetchJSON } from "https://esm.town/v/sean/fetchJSON";
2import { toQueryString } from "https://esm.town/v/sean/toQueryString";
3
16
17 try {
18 const json = await fetchJSON(
19 `https://${API_HOST}/query?${queryString}`,
20 {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getEpicTvProduct = async (url) => {
4 const cheerio = await import("npm:cheerio@1.0.0-rc.12");
5 const html = await (await fetch(url)).text();
6 const $ = cheerio.load(html);
7 return {
1import { fetchJSON } from "https://esm.town/v/mgruel/fetchJSON";
2
3type PaginatedData<T> = {
16 let nextUrl = url;
17 while (nextUrl) {
18 const { data, links } = await fetchJSON<PaginatedData<T>>(
19 nextUrl,
20 options,
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const fetchText = (
4 url: string | URL,
5 options?: RequestInit,
6): Promise<string> =>
7 fetch(url, {
8 redirect: "follow",
9 ...options,
1import { parseMenuLine } from "https://esm.town/v/tal/parseMenuLine";
2import { fetchDOEMenu } from "https://esm.town/v/tal/fetchDOEMenu";
3
4export const testDoeMenuLines = (async () => {
5 const menuText = await fetchDOEMenu({
6 schoolYear: "2023-2024",
7 month: "september",
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function emailRandomJoke() {
4 async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();
9 }
10 const randomJoke = await fetchRandomJoke();
11 const setup = randomJoke.setup;
12 const punchline = randomJoke.punchline;
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