4// Customizable notifications for customizable content for a customizable new criteria
5// Example usage: @stevekrouse.dateMeNotify
6export function notifyNewBy<A>({ getData, isNew, notify, name }: {
7 getData: (d?: Date) => A[] | Promise<A[]>;
8 isNew: (params: {
13 name?: string;
14}) {
15 return async function ({ lastRunAt }: Interval) {
16 const data = await getData(lastRunAt);
17 let newData = data.filter((data) => isNew({ data, lastRunAt }));
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1import { getUrlHostname } from "https://esm.town/v/iakovos/getUrlHostname";
2
3export function renderTopStories(stories: {
4 id: number;
5 title: string;
37 .pipe(new StringOutputParser());
38 // RunnableSequence.from() is equivalent to `.pipe().pipe()`
39 // but will coerce objects (and functions) into runnables
40 const questionStyleChain = RunnableSequence.from([
41 {
2import { fetchAlerts } from "https://esm.town/v/roop/fetchAlerts";
3
4export async function currentCommuteAlertMessages() {
5 const alerts = (await fetchAlerts()).entity;
6 const filtered = filterAlertsByLineAndStation(alerts);
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1// This tries to fetch a specific post on multiple Lemmpy instances
2// and can try to fix missing comments on a specific instance.
3export async function getLemmyPosts(instance: string, communityName: string) {
4 const { LemmyHttp } = await import("npm:lemmy-js-client");
5 let client = new LemmyHttp(`https://${instance}`, {
6 fetchFunction: fetch,
7 });
8 const { posts } = await client.getPosts({
1export function api500(req: express.Request, res: express.Response) {
2 res.status(503);
3 res.json({
A helper function to build a file's email
Simple functional CSS library for Val Town
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.