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// Activity suggestions for when you're bored
4export let boredActivities = fetchJSON(
5 "https://www.boredapi.com/api/activity"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const fetchPelotonWorkouts = async (user_id, session_id) => {
4 const workouts = await fetch(
5 `https://api.onepeloton.com/api/user/${user_id}/workouts?=peloton.ride&limit=50&page=0&sort_by=-created`,
6 {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getMktpTotals() {
15 "Content-Type": "application/json",
16 };
17 const response = await fetch(
18 "https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery",
19 {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const internalStreamThesephistComRSS = (async () => {
7 const { default: he } = await import("npm:he");
8 async function getRss() {
9 return fetch("https://stream.thesephist.com/?n=25")
10 .then(function (response) {
11 return response.text();
45 })
46 .catch(function (err) {
47 return "Failed to fetch page: " + err;
48 });
49 }
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let fetchABird = async () => {
4 const MAX_ID = 777905;
5 const baseUrl = "https://xeno-canto.org/api/2/recordings";
6 const minAnimalId = Math.floor(Math.random() * (MAX_ID + 10));
7 const query = `?query=nr:${minAnimalId}-${minAnimalId + 10}`;
8 const response = await fetch(`${baseUrl}${query}`);
9 const json = await response.json();
10 return json.recordings[Math.floor(Math.random() * 9)];
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const fourchan_catalog = (board: string) =>
4 fetchJSON(`https://a.4cdn.org/${board}/catalog.json`);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const isCloseToCitibikeStation = async ({ lon, lat }) => {
7 const dist = (station) =>
8 Math.sqrt(Math.pow(station.lat - lat, 2) + Math.pow(station.lon - lon, 2));
9 const { data } = await fetchJSON(
10 "https://gbfs.citibikenyc.com/gbfs/en/station_information.json",
11 );
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 { fetch } from "https://esm.town/v/std/fetch";
2
3export async function pug(
14 const { default: genCode } = await pugCodegen;
15 const pugFnStr = genCode(parser.parse(), { inlineRuntimeFunctions: true });
16 const evalResp = await fetch("https://api.val.town/v1/eval", {
17 method: "POST",
18 body: JSON.stringify({