Runs every 15 min
Fork
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;
}
}
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.