Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@bochilteam/scraper/lib/cjs/primbons/nomorhoki.js
1126 views
1
"use strict";
2
var __importDefault = (this && this.__importDefault) || function (mod) {
3
return (mod && mod.__esModule) ? mod : { "default": mod };
4
};
5
Object.defineProperty(exports, "__esModule", { value: true });
6
const got_1 = __importDefault(require("got"));
7
const utils_js_1 = require("../utils.js");
8
async function nomorhoki(nomer) {
9
var _a, _b, _c, _d;
10
const config = {
11
nomer: encodeURIComponent(nomer),
12
submit: '+Submit!+'
13
};
14
const data = await got_1.default
15
.post('https://www.primbon.com/no_hoki_bagua_shuzi.php', {
16
headers: {
17
'content-type': 'application/x-www-form-urlencoded'
18
},
19
form: config
20
})
21
.text();
22
const results = data
23
.split('</b><br></td></tr><tr><td')[0]
24
.split(`<br><b>No. HP : ${nomer}</b><br>`)[1];
25
const angka_bagua_shuzi = parseInt((_b = (_a = results === null || results === void 0 ? void 0 : results.split('Angka Bagua Shuzi :')[1]) === null || _a === void 0 ? void 0 : _a.split('</b><br><br>')[0]) === null || _b === void 0 ? void 0 : _b.replace(/&#37/gi, ''));
26
if (!angka_bagua_shuzi)
27
throw new utils_js_1.ScraperError(`Can't get data, maybe your number(${nomer}) invalid!`);
28
const kekayaan = parseInt(results.split('Kekayaan =')[1].split('<br>')[0]);
29
const kesehatan = parseInt(results.split('Kesehatan =')[1].split('<br>')[0]);
30
const cinta = parseInt(results.split('Cinta/Relasi =')[1].split('<br>')[0]);
31
const kestabilan = parseInt(results.split('Kestabilan =')[1].split('<br>')[0]);
32
const positif = parseInt((_c = results
33
.split('</b><br></td><td><!-- space -->')[0]
34
.split('b>% = ')[1]) === null || _c === void 0 ? void 0 : _c.replace(/&#37/gi, ''));
35
const perselisihan = parseInt(results.split('Perselisihan =')[1].split('<br>')[0]);
36
const kehilangan = parseInt(results.split('Kehilangan =')[1].split('<br>')[0]);
37
const malapetaka = parseInt(results.split('Malapetaka =')[1].split('<br>')[0]);
38
const Kehancuran = parseInt(results.split('Kehancuran =')[1].split('<br>')[0]);
39
const negatif = parseInt((_d = results.split('Kehancuran =')[1].split('<b>% =')[1]) === null || _d === void 0 ? void 0 : _d.replace(/&#37/gi, ''));
40
return {
41
nomer: nomer,
42
angka_bagua_shuzi,
43
positif: {
44
kekayaan,
45
kesehatan,
46
cinta,
47
kestabilan,
48
positif
49
},
50
negatif: {
51
perselisihan,
52
kehilangan,
53
malapetaka,
54
Kehancuran,
55
negatif
56
}
57
};
58
}
59
exports.default = nomorhoki;
60
//# sourceMappingURL=nomorhoki.js.map
61