Avatar

xuangong

3 public vals
Joined July 19, 2023
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
28
29
30
31
32
export function ruleAndroidAppsCheck(response) {
const requiredApps = [
"55a54008ad1ba589aa210d2629c1df41",
"94b3bfd329374b9fb288f72cfcdcd4da",
"9ddc1d1392af462895f23c9aa7a64de1",
"30055ae3c14f46c38f11df1833a51893",
// "da65c5be95db4c09a68627e81a44d63c", // Scaffolding
"1876cd4464a749dbab0acfd57d797f90",
"15e54d64b8de45b1b869d012ba346c2f",
"6631176c87a24532b1a109205aec5e51",
"604b26fcabd84382be12777eddb538bf",
"0067acd6d05f4168b92f510d33b9ed74",
"32649384730b2d61c9e79d46de589115",
"c58cea7ef6e89ca39f9401edb12d241d",
"a9dbd9f32ca0f65d3132adac27137447",
// "a2db74d5666f462b8bf0df5ccd6a4fcf", // Sydney
// "6dc7564de7424d4698716df1b6d86867", // SydneyChat
"707225db60754189939e45b17b59ca13",
"559c57a353f445d6b7796d0d8c4932d9",
"d907c956035445239a134ad443f27294",
"90e07f90f13244d0ba8648db61bb198b",
"3539b7a134684b88addd55262f04d96b",
// "4fb480cc8d0746ebb7bc2ef6bc6f172a", // InAppBrowser
"5f9c29b288ec4c638677796251e04420", // Accounts
];
const apps = response.data.apps;
const appIds = apps.map((it) => it.appId);
const validate =
requiredApps.filter((appId) => appIds.includes(appId)).length ===
requiredApps.length;
return validate;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { fetch } from "https://esm.town/v/std/fetch";
import { ruleAndroidAppsCheck } from "https://esm.town/v/xuangong/ruleAndroidAppsCheck";
export async function testAndroidBingApps() {
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 validate = ruleAndroidAppsCheck(data);
return validate ? "normal" : "missing";
}
catch (error) {
console.error("Error:", error);
return "Error occurred while accessing the URL ," + error.message;
}
}
1
2
3
4
5
6
7
8
// email yourself as easily as logging to the console: `console.email`
export let consoleEmailEx = (() => {
console.email("message"); // any JSON object can be the message
console.email({ html: "<h1>hello html emails!</h1>" }); // you can send HTML emails
console.email({ hi: "there" }, "Subject Line"); // optional second arg is the subject line
console.email({ html: "<b>hi!</b>", subject: "Subject accepted here too" });
})();
// Forked from @stevekrouse.consoleEmailEx
Next