1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { getHashForUrl } from "https://esm.town/v/janpaul123/getHashForUrl";
import { blob } from "https://esm.town/v/std/blob";
import { email } from "https://esm.town/v/std/email?v=12";
export default async function(interval: Interval) {
const dynamiclandWebsiteHash = await blob.getJSON("dynamiclandWebsiteHash");
const newHash = await getHashForUrl("https://dynamicland.org/");
if (newHash !== dynamiclandWebsiteHash) {
console.log("New hash found!", { dynamiclandWebsiteHash, newHash });
await blob.setJSON("dynamiclandWebsiteHash", newHash);
await email({ text: `Dynamicland website has changed! New hash: ${newHash}` });
} else {
console.log("Hash is the same, no email sent.", { dynamiclandWebsiteHash });
}
}
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!
April 4, 2024