Runs every 1 days
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { set } from "https://esm.town/v/std/set?v=11";
import { email } from "https://esm.town/v/std/email?v=9";
import { pollRSSInkAndSwitch } from "https://esm.town/v/stevekrouse/pollRSSInkAndSwitch";
import { inkAndSwitchRssUrl } from "https://esm.town/v/stevekrouse/inkAndSwitchRssUrl";
import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems";
export async function pollRSSFeeds2() {
let items = await newRSSItems({
url: inkAndSwitchRssUrl,
lastRunAt: pollRSSInkAndSwitch,
});
if (items.length)
await email({
text: JSON.stringify(items, null, 2),
subject: `New RSS Item`,
});
return set("pollRSSInkAndSwitch", Date.now());
}
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!
October 23, 2023