Poll RSS feeds

This val periodically polls specified RSS feeds and send the author an email with new items. It checks each feed defined in rssFeeds for new content since the last run and sends an email with the details of the new items.

Usage

  1. Fork @stevekrouse/rssFeeds and update it with your desired RSS feeds;
  2. Fork this val and replace the https://esm.town/v/stevekrouse/rssFeeds import with your newly forked val;
  3. Enjoy RSS updates on your email!
Runs every 1 days
Fork
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { email } from "https://esm.town/v/std/email?v=9";
import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems";
import { rssFeeds } from "https://esm.town/v/stevekrouse/rssFeeds";
export async function pollRSSFeeds({ lastRunAt }: Interval) {
return Promise.all(
Object.entries(rssFeeds).map(async ([name, url]) => {
let items = await newRSSItems({
url,
lastRunAt,
});
if (items.length)
await email({
text: JSON.stringify(items, null, 2),
subject: `New from ${name} RSS`,
});
return { name, items };
}),
);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { email } from "https://esm.town/v/std/email?v=9";
import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems";
const rssFeeds = {
"Neovim": "https://github.com/neovim/neovim/releases.atom",
}
export async function pollRSSFeeds({ lastRunAt }: Interval) {
return Promise.all(
Object.entries(rssFeeds).map(async ([name, url]) => {
let items = await newRSSItems({
url,
lastRunAt,
});
if (items.length)
await email({
text: JSON.stringify(items, null, 2),
subject: `New from ${name} RSS`,
});
return { name, items };
}),
);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems?v=6";
import { rssFeeds } from "https://esm.town/v/rodrigotello/rssFeeds";
export function pollRSSFeeds({ lastRunAt }) {
return Promise.all(
Object.entries(rssFeeds).map(async ([name, url]) => {
let items = await newRSSItems({
url,
lastRunAt,
});
if (items.length) console.email(items, `New from ${name} RSS`);
return { name, items };
})
);
}
// Forked from @stevekrouse.pollRSSFeeds
1
Next