Avatar

andrewn

5 public vals
Joined May 25, 2023
1
2
3
4
5
6
7
8
9
import { fetchRSS } from "https://esm.town/v/stevekrouse/fetchRSS";
export let newRSSItems = ({ url, lastRunAt }) =>
fetchRSS(url)
.then(({ channel: { item } }) =>
(Array.isArray(item) ? item : [item]).filter(
({ pubDate }) => lastRunAt && new Date(pubDate) > new Date(lastRunAt),
)
);
1
2
3
export function myApi() {
return { something: "is happening" };
}
1
2
3
4
export let npmExample = (async () => {
const _ = await import("npm:lodash-es"); // The Lodash library exported as ES modules.
return { data: _.shuffle(_.zip([1, 2, 3, 4], [5, 6, 7, 8])) };
})();
1
2
3
4
5
6
7
8
9
import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
export async function dailyMathFact() {
let mathFact = await fetchText(
"http://numbersapi.com/random/math",
);
return { data: mathFact };
// console.email(mathFact, "Daily Math Fact");
}
1
2
3
4
5
6
7
8
import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
export const text = (async () => {
let mathFact = await fetchText(
"http://numbersapi.com/random/math",
);
return { data: `${mathFact} ${mathFact} ${mathFact}` };
})();
Next