1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { check_reddit } from "https://esm.town/v/bnorick/check_reddit";
export async function reddit_alert_example({ lastRunAt }) {
console.log(`last run at ${lastRunAt.getTime() / 1000}`);
return await check_reddit({
check: {
username: "YOUR_VAL_TOWN",
last_run_at_utc: lastRunAt.getTime() / 1000,
filters: {
homelabsales: [
"wyse",
"optiplex",
"t6[23]0",
"thin client",
{ pattern: "usff", strategy: "wordmatch" },
],
hardwareswap: [
"b450",
"thin client",
{ pattern: "usff", strategy: "wordmatch" },
],
},
},
});
}
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.