1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const scheduleExample = () => fetch("example.com");
1import { fetchJSON } from "https://esm.town/v/sean/fetchJSON";
2import { toQueryString } from "https://esm.town/v/sean/toQueryString";
3
27
28 try {
29 const json = await fetchJSON(
30 `https://${API_HOST}/query?${queryString}`,
31 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Activity suggestions for when you're bored
4export let boredActivities = fetchJSON(
5 "https://www.boredapi.com/api/activity",
6);
1import { nowcastPMAqi } from "https://esm.town/v/stevekrouse/nowcastPMAqi?v=6";
2import { msHour } from "https://esm.town/v/stevekrouse/msHour?v=1";
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
4
5export async function nowCastPMAQI({ location_id }) {
6 const { results } = await fetchJSON(
7 "https://api.openaq.org/v2/measurements?" +
8 new URLSearchParams({
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Reddit recent posts from /r/aww (cute animals)
4export let subredditExample = fetchJSON(
5 "https://www.reddit.com/r/aww/.json"
6);
1import process from "node:process";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export const likedUpdated = async (interval: Interval) => {
7 return;
8 }
9 const res = await fetchJSON(
10 "https://api.val.town/v1/me/likes",
11 {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getDictCSV = async () => {
4 const CSV_URL = "https://docs.google.com/spreadsheets/d/e/2PACX-1vSaIstzxO8d2J37TZjcFQfk4cN3unhuq_e-SD5L6pLvwSxrg-h836e8uIyWmuxjsG3LIbcxKLxO_8aZ/pub?output=csv";
5 const csvString = (await fetch(CSV_URL)).text();
6 return csvString;
7}
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let map = async (zipA, latB, longB) => {
4 let f = await fetch(
5 `https://maps.googleapis.com/maps/api/staticmap?auto=&scale=2&size=600x300&maptype=roadmap&format=png&key=AIzaSyBkrVgpa0Ul-_LN7cVq8ws6oYfQi3zCjuU&markers=size:mid%7Ccolor:0xdc2626%7Clabel:1%7CLos%20Angeles%2CCA%2C${zipA}&markers=size:mid%7Ccolor:0xdc2626%7Clabel:2%7C${latB}%2C${longB}`
6 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);
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);