3// Random math fact
4export let mathFact = fetchText(
5 "http://numbersapi.com/random/math"
6);
1export function myApi(name) {
2 return "hi " + name;
3}
2
3export let nameTopHNThread = (async () => {
4 // Cheerio parses markup and provides an API to interact with the resulting data structure
5 const cheerio = await import("npm:cheerio"); // You can import NPM packages
6 const reply = await fetch("https://news.ycombinator.com/");
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
6 const { parse } = await import("https://deno.land/x/xml/mod.ts");
7 const res: any = await fetch(
8 "https://bizfileonline.sos.ca.gov/api/FilingDetail/business/4603/false",
9 {
10 headers: {
1import { exportedKeys } from "https://esm.town/v/stevekrouse/exportedKeys";
2import { runValAPIAuth } from "https://esm.town/v/stevekrouse/runValAPIAuth";
3
4export const authRequestEx = runValAPIAuth({
5 val: "@stevekrouse.exampleAuthApi",
6 args: [1, 3],
7 keys: exportedKeys,
46 //
47 const limit = await fetchJSON(
48 `https://api.rlimit.com/limit/${namespaceId}/${type}/${max}/${interval}/${key}?cost=${cost}&subNamespace=${subNamespace}&password=${pass}`,
49 );
50 return limit;
3export const getPublicVals = async (username) => {
4 let { id } = await fetchJSON(
5 `https://api.val.town/v1/alias/${username}`,
6 );
7 return fetchJSON(
8 `https://api.val.town/v1/users/${id}/vals`,
9 );
10};
1import { TEST_API } from "https://esm.town/v/stevekrouse/TEST_API";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
16}) {
17 const { data: last } = await fetchJSON(
18 `${TEST_API}/eval/${stateName}`
19 );
20 const now = Date.now();
21 await fetchJSON(
22 `${TEST_API}/eval/${mutator(now)}`
23 );
24 const { data: next } = await fetchJSON(
25 `${TEST_API}/eval/${stateName}`
26 );
27 const mutated = next === now;