Readme

HN Follow – Follow your friends on HN

HN Follow lets you follow authors on Hacker News, and get email notifications when they post. It was inspired by alerthn.com and hnreplies.com.

Usage

Create a cron val with the a list of the people you want to follow in a JS array, like so:

export const hnFollow = hnFollowApp([ "pg", "sama", "geoff", "stevewoz", "tlb", "harj", "alankay", "worrydream", "norvig", "dalton", "mwseibel", "katm", "brianchesky", "dang", ]);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { email } from "https://esm.town/v/std/email?v=9";
import { hnEmail } from "https://esm.town/v/rodrigotello/hnEmail";
import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts?v=18";
export const hnFollowApp = function (authors: string[]) {
return async function ({ lastRunAt }) {
let posts = await hnLatestPosts({
authors,
lastSyncTime: lastRunAt,
search_by_date: true,
});
let { html, subject } = await hnEmail({ posts });
if (posts.length)
await email({ html, subject });
};
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
June 10, 2024