Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { email } from "https://esm.town/v/std/email?v=9";
import { fetch } from "https://esm.town/v/std/fetch";
export async function getUltimesNoticies() {
const fetchResponse = await fetch(
"https://www.ccma.cat/324/ultimes-noticies/",
);
const responseText = await fetchResponse.text();
const now = new Date();
await email({
html: responseText.replaceAll(
"//statics.ccma.cat/css",
"https://statics.ccma.cat/css",
),
subject: `324: Últimes notícies (${now.toISOString()})`,
});
}
June 23, 2024