1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function discordChannel({ botToken, serverId }) {
4 return fetchJSON(
5 `https://discord.com/api/guilds/${serverId}/channels`,
1export function getDayName(date?: Date) {
2 return (date ?? new Date()).toLocaleDateString("en-US", { weekday: "long" });
3}
3import { docsFeedback } from "https://esm.town/v/stevekrouse/docsFeedback";
4
5export async function formFeedbackAlert(interval: Interval) {
6 let newFeedback = docsFeedback
7 .filter((f) => new Date(f.time) > interval.lastRunAt);
3import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts";
4
5export async function hnFollowPollJobError({ lastRunAt }: Interval) {
6 try {
7 let posts = await hnLatestPosts({
1import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems?v=6";
2
3export async function pollRSSFeeds() {
4 return Object.entries({
5 mine: "https://macwright.com/rss.xml",
3import { verifyAPIAuth } from "https://esm.town/v/stevekrouse/verifyAPIAuth";
4
5export async function exampleAuthApi(arg1, arg2, auth) {
6 let { handle } = await verifyAPIAuth(auth);
7 if (handle) {
1import { wikidata } from "https://esm.town/v/stevekrouse/wikidata";
2
3export async function alive(name) {
4 let data = await wikidata(
5 `SELECT ?person ?personLabel ?birth_date ?death_date WHERE {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function nominatimSearch(params: Search): Promise<Place[]> {
4 return fetchJSON(
5 "https://nominatim.openstreetmap.org/search?" +
2import { pixelData } from "https://esm.town/v/stevekrouse/pixelData";
3
4export async function pixel(req: express.Request, res: express.Response) {
5 if (req.path === "/") {
6 let html = `
23 let img = document.getElementsByTagName("img")[0]
24 let input = document.getElementsByTagName("input")[0]
25 input.addEventListener('input', function(e){
26 img.src="/track?id=" + e.target.value
27 })
3import { set } from "https://esm.town/v/std/set?v=11";
4
5export async function testEmail2(e: {
6 from: string;
7 to: string[];