1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import process from "node:process"
export function pushplus(options: {
token: string;
title?: string;
content: any;
template?:
| "html"
| "txt"
| "json"
| "markdown"
| "cloudMonitor"
| "jenkins"
| "route"
| "pay";
channel?: "wechat" | "webhook" | "cp" | "mail" | "sms";
webhook?: string;
callbackUrl?: string;
timestamp?: number; // ms
}) {
return fetch("http://www.pushplus.plus/send", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ token: process.env.pushplus, ...options }),
});
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
v4
May 2, 2024