1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let aqi = async () => {
4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
4export const slackWebHookMessageExample = (async () => {
5 const res = await fetch(process.env.slackWebhookURL, {
6 method: "POST",
7 body: JSON.stringify({
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const telegramGetUpdates = async (botToken: string) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/getUpdates`,
6 );
1// fetch("https://api.val.town/v1/express/galligan.generateQR?url={url}"
2// QR Code Generator
3// 1. Right click on the bookmarks bar and add new bookmark
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Predict the nationality of a name
4export let nameNationality = fetchJSON(
5 "https://api.nationalize.io/?name=michael"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub events
4export let githubEvents = fetchJSON(
5 "https://api.github.com/users/stevekrouse/events"
6);
1import { manchesterBerylStationStatus } from "https://esm.town/v/neverstew/manchesterBerylStationStatus";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export let manchesterBerylStations = fetchJSON(
5 "https://gbfs.beryl.cc/v2_2/Greater_Manchester/station_information.json",
6).then((data) =>
1import { searchParams } from "https://esm.town/v/stevekrouse/searchParams?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export function comments({ token, relationship, since, until, offset, limit }: {
34 };
35}> {
36 return fetchJSON(
37 "https://api.val.town/v1/me/comments?" +
38 searchParams({
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let fetchJSON = async (url: string, options?: any) => {
4 let f = await fetch(url, {
5 ...options,
6 headers: {
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export async function dailyMathFact() {
4 let mathFact = await fetchText(
5 "http://numbersapi.com/random/math",
6 );