Public
Cron
Forked from sebdd/tootLatestPosts
Runs every 1 hrs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { postToMastodon } from "https://esm.town/v/sebdd/postToMastodon";
import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems?v=6";
export async function tootLatestPosts({ lastRunAt }: Interval) {
return Promise.all(
(await newRSSItems({
url: "https://crimenesdeodio.info/es/rss-feed-yearly",
lastRunAt,
}))
.slice(0, 2)
.map((item) =>
postToMastodon(
"https://floss.social/api/v1",
Deno.env.get("mastodonAccessToken"),
`${item.title.charAt(0) === "β" ? "π" : "βοΈ"} ${item.title.replace("β ", "")} ${item.link}`,
)
),
);
}
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!
May 13, 2024