11export async function fetchCongressTradeReports(callback) {
12 const res = await fetchJSON(
13 "https://bff.capitoltrades.com/trades?sortBy=-pubDate"
14 );
15 const trades = res.data;
3export const getTrains = (async () => {
4 const skerries = await fetch(
5 "https://irish-rail-rest-api.fly.dev/stations/SKRES/timetable",
6 ).then((res) => res.json());
7 const connolly = await fetch(
8 "https://irish-rail-rest-api.fly.dev/stations/CNLLY/timetable",
9 ).then((res) => res.json());
10 return {
93export async function getOpenMeteoForecast(params: OMParams) {
94 const data = await fetchJSON(
95 `https://api.open-meteo.com/v1/forecast?${new URLSearchParams(
96 params as {} // Typescript is stricter than Deno here
97 ).toString()}`
1import { testMutateSemantics } from "https://esm.town/v/stevekrouse/testMutateSemantics";
2
3export const unauthenticatedCanMutateViaObjectSneak = (api) =>
4 testMutateSemantics({
5 stateName: "@stevekrouse.testState",
6 api,
7 expected: (old, next) => next.n2 === next.n,
8 mutator: (now) => `(() => {
1export function myApi(name) {
2 console.email("yay " + name);
3 return "hi :)" + name;
3export let convertCurrency = async (desired, base = "usd", amount = 1) => {
4 let { rates } = await fetchJSON(
5 `https://open.er-api.com/v6/latest/${base}`,
6 );
7 if (rates && rates[desired.toUpperCase()])
9 else {
10 let { rates } = await fetchJSON(
11 "https://api.coingecko.com/api/v3/exchange_rates",
12 );
13 return amount * rates[desired.toLowerCase()]?.value /
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}