Avatar

meatcar

2 public vals
Joined January 11, 2023
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { fetch } from "https://esm.town/v/std/fetch";
// Send a pushover message.
// token, user, and other opts are as specified at https://pushover.net/api
export async function pushover({ token, user, message, title, url, ...opts }) {
return await fetch("https://api.pushover.net/1/messages.json", {
method: "POST",
body: JSON.stringify({
token,
user,
message,
title,
url,
...opts,
}),
});
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import process from "node:process";
import { pushover } from "https://esm.town/v/meatcar/pushover";
import { watchWebsite } from "https://esm.town/v/chet/watchWebsite?v=7";
export async function watchLCBO_JD3L() {
const url = "https://www.lcbo.com/en/storeinventory/?sku=517383";
const { subject, body } = await watchWebsite(url);
return pushover({
token: process.env.pushover_app_key,
user: process.env.pushover_user_key,
message: body,
title: subject,
url,
});
}
Next