1import { nowcastPMAqi } from "https://esm.town/v/stevekrouse/nowcastPMAqi";
2import { msHour } from "https://esm.town/v/stevekrouse/msHour";
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
4
5export async function openAqNowcastAQI({ location_id }) {
6 const { results } = await fetchJSON(
7 "https://api.openaq.org/v2/measurements?" +
8 new URLSearchParams({
1import { fetchABird } from "https://esm.town/v/crsven/fetchABird?v=1";
2
3export let exampleBird = fetchABird();
1import { parseHTML } from "https://esm.town/v/stevekrouse/parseHTML";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
3
4// this function doesn't work yet, I'm still iterating on it
5export function fetchHTML(url: string, options?: any) {
6 return fetchText(url, options)
7 .then(parseHTML);
8}
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
2
3export const noProxyEx = fetchText(
4 "https://www.schools.nyc.gov/docs/default-source/school-menus/2022-2023/june/pre-k---8-lunch-menu",
5 {
1import { dateMeURL } from "https://esm.town/v/stevekrouse/dateMeURL";
2import { fetchTable } from "https://esm.town/v/stevekrouse/fetchTable";
3
4export const dateMeProfiles = fetchTable(
5 dateMeURL,
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function runAllTests({
19 results.push(
20 (
21 await fetchJSON(
22 `${api}/eval/@stevekrouse.${name}("${encodeURIComponent(api)}")`
23 )
1import { fetchDateMeProfiles } from "https://esm.town/v/stevekrouse/fetchDateMeProfiles";
2import { notifyNew } from "https://esm.town/v/stevekrouse/notifyNew";
3
6// Requires an upstash account: https://docs.val.town/persistence-databases/upstash
7export let dateMeNotify = notifyNew({
8 getData: fetchDateMeProfiles,
9 name: "Date Me Profile",
10});
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3// GitHub events
4export let githubEvents = fetchJSON(
5 "https://api.github.com/users/stevekrouse/events"
6);
1import { msDay } from "https://esm.town/v/stevekrouse/msDay?v=1";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export let openAQLocation = async ({
12 return q.charAt();
13 // Test
14 const { results } = fetchJSON(
15 "https://api.openaq.org/v2/locations?" +
16 new URLSearchParams({
1import { searchParams } from "https://esm.town/v/stevekrouse/searchParams";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export const redditNew = async ({ r, before }: { r: string, before?: string }) =>
5 fetchJSON(
6 `https://www.reddit.com/r/${r}/new/.json?${await searchParams(
7 { before }