Runs every 15 min
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
26
27
import { rule } from "https://esm.town/v/cescyang_service/rule";
import { email } from "https://esm.town/v/std/email?v=9";
import { fetch } from "https://esm.town/v/std/fetch";
export async function checkAndroidBingApps() {
const { default: axios } = await import("npm:axios");
const url =
"https://sapphire.api.microsoftapp.net/config/api/v1/get?setmkt=en-us&setplatform=android&setchannel=production&settenant=sapphire-bing";
try {
const response = await fetch(url, {
method: "GET",
});
const data = await response.json();
console.log(data);
const validateData = rule(data);
if (!validateData?.validate) {
email({
text: "ios config missing\n" + validateData.difference,
subject: "ios config missing\n" + validateData.difference,
});
}
}
catch (error) {
console.error("Error:", error);
return "Error occurred while accessing the URL , " + error.message;
}
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
v7
November 29, 2023