stack-analyze 1.1.8 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -2
- package/about.js +97 -45
- package/cli.js +127 -18
- package/demo.js +20 -0
- package/functions/animeInfo.js +3 -6
- package/functions/bitly.js +1 -1
- package/functions/cryptoList.js +9 -8
- package/functions/gitUser.js +1 -1
- package/functions/hardware.js +195 -243
- package/functions/moviesInfo.js +3 -7
- package/functions/multipleStack.js +13 -8
- package/functions/pageSpeed.js +1 -1
- package/functions/scraping.js +153 -0
- package/functions/singleStack.js +14 -9
- package/functions/twitch.js +3 -4
- package/index.cjs +141 -114
- package/index.mjs +141 -119
- package/package.json +9 -8
- package/readme.md +11 -3
- package/utils.js +15 -0
- package/.vscode/settings.json +0 -4
- package/hash/aboutOpts.js +0 -53
- package/hash/hardwareTools.js +0 -47
- package/models/aboutTables.js +0 -40
- package/models/animeTable.js +0 -33
- package/models/cryptoTables.js +0 -32
- package/models/hardwareTables.js +0 -87
- package/models/movieTables.js +0 -33
- package/models/stackTables.js +0 -23
- package/models/twitchTables.js +0 -28
package/functions/hardware.js
CHANGED
|
@@ -1,249 +1,201 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
import {
|
|
3
|
-
cpu,
|
|
4
|
-
mem,
|
|
5
|
-
osInfo,
|
|
6
|
-
diskLayout,
|
|
7
|
-
graphics,
|
|
8
|
-
bios
|
|
2
|
+
import {
|
|
3
|
+
cpu,
|
|
4
|
+
mem,
|
|
5
|
+
osInfo,
|
|
6
|
+
diskLayout,
|
|
7
|
+
graphics,
|
|
8
|
+
bios
|
|
9
9
|
} from "systeminformation";
|
|
10
10
|
import colors from "colors";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
console.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
console.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
resolutionY
|
|
198
|
-
}) => ({
|
|
199
|
-
model,
|
|
200
|
-
main,
|
|
201
|
-
connection,
|
|
202
|
-
resolutionX,
|
|
203
|
-
resolutionY
|
|
204
|
-
}));
|
|
205
|
-
|
|
206
|
-
// show results
|
|
207
|
-
displayTables.addRows(displayList);
|
|
208
|
-
displayTables.printTable();
|
|
209
|
-
} catch (err) {
|
|
210
|
-
console.error(colors.red(err.message));
|
|
11
|
+
import { printTable } from "console-table-printer";
|
|
12
|
+
|
|
13
|
+
/** @type {Object.<string, function(): Promise<void>>} */
|
|
14
|
+
const hardwareTools = {
|
|
15
|
+
async cpuInfo() {
|
|
16
|
+
console.clear();
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const {
|
|
20
|
+
manufacturer,
|
|
21
|
+
brand,
|
|
22
|
+
speed,
|
|
23
|
+
cores,
|
|
24
|
+
physicalCores,
|
|
25
|
+
processors,
|
|
26
|
+
vendor,
|
|
27
|
+
family,
|
|
28
|
+
model
|
|
29
|
+
} = await cpu();
|
|
30
|
+
|
|
31
|
+
// show results
|
|
32
|
+
console.table({
|
|
33
|
+
manufacturer,
|
|
34
|
+
brand,
|
|
35
|
+
speed,
|
|
36
|
+
cores,
|
|
37
|
+
physicalCores,
|
|
38
|
+
processors,
|
|
39
|
+
vendor,
|
|
40
|
+
family,
|
|
41
|
+
model
|
|
42
|
+
});
|
|
43
|
+
} catch (err) {
|
|
44
|
+
console.error(colors.red(err.message));
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
async ramMemInfo() {
|
|
48
|
+
console.clear();
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
const {
|
|
52
|
+
total,
|
|
53
|
+
free,
|
|
54
|
+
used,
|
|
55
|
+
active,
|
|
56
|
+
available
|
|
57
|
+
} = await mem();
|
|
58
|
+
|
|
59
|
+
// show results
|
|
60
|
+
console.table({
|
|
61
|
+
total_mem: `${(total / 1073741824).toFixed(2)} GB`,
|
|
62
|
+
free_mem: `${(free / 1073741824).toFixed(2)} GB`,
|
|
63
|
+
used_mem: `${(used / 1073741824).toFixed(2)} GB`,
|
|
64
|
+
active_mem: `${(active / 1073741824).toFixed(2)} GB`,
|
|
65
|
+
available_mem: `${(available / 1073741824).toFixed(2)} GB`
|
|
66
|
+
});
|
|
67
|
+
} catch (err) {
|
|
68
|
+
console.error(colors.red(err.message));
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
async osDetail() {
|
|
72
|
+
console.clear();
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
const {
|
|
76
|
+
hostname,
|
|
77
|
+
platform,
|
|
78
|
+
distro,
|
|
79
|
+
release,
|
|
80
|
+
kernel,
|
|
81
|
+
arch,
|
|
82
|
+
serial,
|
|
83
|
+
uefi
|
|
84
|
+
} = await osInfo();
|
|
85
|
+
|
|
86
|
+
// show results
|
|
87
|
+
console.table({
|
|
88
|
+
hostname,
|
|
89
|
+
platform,
|
|
90
|
+
distro,
|
|
91
|
+
release,
|
|
92
|
+
kernel,
|
|
93
|
+
arch,
|
|
94
|
+
serial,
|
|
95
|
+
uefi
|
|
96
|
+
});
|
|
97
|
+
} catch (err) {
|
|
98
|
+
console.error(colors.red(err.message));
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
async diskInfo() {
|
|
102
|
+
console.clear();
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
const disks = await diskLayout();
|
|
106
|
+
|
|
107
|
+
const disksList = disks.map(({
|
|
108
|
+
type,
|
|
109
|
+
name,
|
|
110
|
+
vendor,
|
|
111
|
+
size,
|
|
112
|
+
interfaceType
|
|
113
|
+
}) => ({
|
|
114
|
+
type,
|
|
115
|
+
name,
|
|
116
|
+
vendor,
|
|
117
|
+
diskSize: `${(size / 1073741824).toFixed(2)} GB`,
|
|
118
|
+
interfaceType
|
|
119
|
+
}));
|
|
120
|
+
|
|
121
|
+
printTable(disksList);
|
|
122
|
+
|
|
123
|
+
} catch (err) {
|
|
124
|
+
console.error(colors.red(err.message));
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
async controllerInfo() {
|
|
128
|
+
console.clear();
|
|
129
|
+
|
|
130
|
+
try {
|
|
131
|
+
const { controllers } = await graphics();
|
|
132
|
+
|
|
133
|
+
const controllersList = controllers.map(({
|
|
134
|
+
model,
|
|
135
|
+
vendor,
|
|
136
|
+
vram
|
|
137
|
+
}) => ({
|
|
138
|
+
model,
|
|
139
|
+
vendor,
|
|
140
|
+
vramSize: vram < 1024
|
|
141
|
+
? `${vram} MB`
|
|
142
|
+
: `${(vram / 1024).toFixed(2)} GB`
|
|
143
|
+
}));
|
|
144
|
+
|
|
145
|
+
// show results
|
|
146
|
+
printTable(controllersList);
|
|
147
|
+
} catch (err) {
|
|
148
|
+
console.error(colors.red(err.message));
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
async displayInfo() {
|
|
152
|
+
console.clear();
|
|
153
|
+
|
|
154
|
+
try {
|
|
155
|
+
const { displays } = await graphics();
|
|
156
|
+
|
|
157
|
+
const displayList = displays.map(({
|
|
158
|
+
model,
|
|
159
|
+
main,
|
|
160
|
+
connection,
|
|
161
|
+
resolutionX,
|
|
162
|
+
resolutionY
|
|
163
|
+
}) => ({
|
|
164
|
+
model,
|
|
165
|
+
main,
|
|
166
|
+
connection,
|
|
167
|
+
resolutionX,
|
|
168
|
+
resolutionY
|
|
169
|
+
}));
|
|
170
|
+
|
|
171
|
+
// show results
|
|
172
|
+
printTable(displayList);
|
|
173
|
+
} catch (err) {
|
|
174
|
+
console.error(colors.red(err.message));
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
async biosInfo() {
|
|
178
|
+
console.clear();
|
|
179
|
+
|
|
180
|
+
try {
|
|
181
|
+
const {
|
|
182
|
+
releaseDate,
|
|
183
|
+
vendor,
|
|
184
|
+
revision,
|
|
185
|
+
version
|
|
186
|
+
} = await bios();
|
|
187
|
+
|
|
188
|
+
console.table({
|
|
189
|
+
releaseDate,
|
|
190
|
+
vendor,
|
|
191
|
+
bios_revision: revision === "" ? "no info" : revision,
|
|
192
|
+
version
|
|
193
|
+
});
|
|
194
|
+
} catch (err) {
|
|
195
|
+
console.error(colors.red(err.message));
|
|
196
|
+
}
|
|
211
197
|
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
*
|
|
216
|
-
* @description call the async function biosinfo
|
|
217
|
-
* @return { Promise<void> } - return bios info results
|
|
218
|
-
*
|
|
219
|
-
*/
|
|
220
|
-
async function biosInfo() {
|
|
221
|
-
try {
|
|
222
|
-
const {
|
|
223
|
-
releaseDate,
|
|
224
|
-
vendor,
|
|
225
|
-
revision,
|
|
226
|
-
version
|
|
227
|
-
} = await bios();
|
|
228
|
-
|
|
229
|
-
console.table({
|
|
230
|
-
releaseDate,
|
|
231
|
-
vendor,
|
|
232
|
-
bios_revision: revision === "" ? "no info" : revision,
|
|
233
|
-
version
|
|
234
|
-
});
|
|
235
|
-
} catch (err) {
|
|
236
|
-
console.error(colors.red(err.message));
|
|
237
|
-
}
|
|
238
|
-
}
|
|
198
|
+
};
|
|
239
199
|
|
|
240
200
|
// exports modules
|
|
241
|
-
export
|
|
242
|
-
cpuInfo,
|
|
243
|
-
ramMemInfo,
|
|
244
|
-
osDetail,
|
|
245
|
-
diskInfo,
|
|
246
|
-
controllerInfo,
|
|
247
|
-
displayInfo,
|
|
248
|
-
biosInfo
|
|
249
|
-
};
|
|
201
|
+
export default hardwareTools;
|
package/functions/moviesInfo.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// modules
|
|
2
|
-
import axios from "axios";
|
|
2
|
+
import { default as axios } from "axios";
|
|
3
3
|
import colors from "colors";
|
|
4
|
-
|
|
5
|
-
// table module
|
|
6
|
-
import movieList from "../models/movieTables.js";
|
|
4
|
+
import { printTable } from "console-table-printer";
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* @description movie info tool
|
|
@@ -43,9 +41,7 @@ const movieDB = async (query, token) => {
|
|
|
43
41
|
})
|
|
44
42
|
.filter(({ release_date }) => release_date !== undefined && release_date !== "");
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
movieList.printTable();
|
|
44
|
+
printTable(movieData);
|
|
49
45
|
} catch (err) {
|
|
50
46
|
console.error(colors.red(err.message));
|
|
51
47
|
}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import figlet from "figlet";
|
|
3
3
|
import Wappalyzer from "wappalyzer";
|
|
4
4
|
import colors from "colors";
|
|
5
|
-
import
|
|
5
|
+
import { printTable } from "console-table-printer";
|
|
6
|
+
|
|
7
|
+
// list format
|
|
8
|
+
import { listFormat } from "../utils.js";
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
11
|
*
|
|
@@ -35,16 +38,18 @@ const multipleStack = async (urls) => {
|
|
|
35
38
|
name,
|
|
36
39
|
website,
|
|
37
40
|
categories
|
|
38
|
-
}) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
}) => {
|
|
42
|
+
const stackCategories = categories.map(({ name }) => name);
|
|
43
|
+
return {
|
|
44
|
+
techName: name,
|
|
45
|
+
techWebsite: website,
|
|
46
|
+
techCategories: listFormat.format(stackCategories)
|
|
47
|
+
};
|
|
48
|
+
});
|
|
43
49
|
|
|
44
50
|
console.info(colors.green(figlet.textSync(url, "Small")));
|
|
45
51
|
console.group();
|
|
46
|
-
|
|
47
|
-
stackTable.printTable();
|
|
52
|
+
printTable(stackResult);
|
|
48
53
|
console.groupEnd();
|
|
49
54
|
});
|
|
50
55
|
} catch (err) {
|
package/functions/pageSpeed.js
CHANGED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { default as axios } from "axios";
|
|
2
|
+
import { load } from "cheerio";
|
|
3
|
+
import colors from "colors";
|
|
4
|
+
import { printTable } from "console-table-printer";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} options
|
|
8
|
+
* @property {function(): Promise<void>} options.title
|
|
9
|
+
* @property {function(): Promise<void>} options.images
|
|
10
|
+
* @property {function(): Promise<void>} options.metadata
|
|
11
|
+
* @property {function(): Promise<void>} options.headings
|
|
12
|
+
* @property {function(): Promise<void>} options.table_heading
|
|
13
|
+
* @property {function(): Promise<void>} options.table_data
|
|
14
|
+
* @property {function(): Promise<void>} options.links
|
|
15
|
+
* @property {function(): Promise<void>} options.cites
|
|
16
|
+
*
|
|
17
|
+
* @param {string} url
|
|
18
|
+
* @returns {options}
|
|
19
|
+
*/
|
|
20
|
+
export default function scrape(url) {
|
|
21
|
+
let $;
|
|
22
|
+
|
|
23
|
+
const scraping = axios.create({
|
|
24
|
+
baseURL: url
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const title = async () => {
|
|
28
|
+
try {
|
|
29
|
+
const { data } = await scraping.get("");
|
|
30
|
+
$ = load(data);
|
|
31
|
+
|
|
32
|
+
console.info("title page:", $("title").text());
|
|
33
|
+
} catch (err) { console.error(colors.red(err.message)); }
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const images = async () => {
|
|
37
|
+
try {
|
|
38
|
+
const { data } = await scraping.get("");
|
|
39
|
+
$ = load(data);
|
|
40
|
+
|
|
41
|
+
const imgs = $("img").map((i, el) => ({
|
|
42
|
+
imagePath: $(el).attr("src"),
|
|
43
|
+
imageTitle: $(el).attr("alt")
|
|
44
|
+
})).toArray();
|
|
45
|
+
|
|
46
|
+
imgs.length === 0
|
|
47
|
+
? console.info("no found images")
|
|
48
|
+
: printTable(imgs);
|
|
49
|
+
} catch (err) { console.error(colors.red(err.message)); }
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const metadata = async () => {
|
|
53
|
+
try {
|
|
54
|
+
const { data } = await scraping.get("");
|
|
55
|
+
$ = load(data);
|
|
56
|
+
|
|
57
|
+
const metadataList = $("meta").map((i, el) => ({
|
|
58
|
+
metaInfo: $(el).attr("name"),
|
|
59
|
+
metaContent: $(el).attr("content")
|
|
60
|
+
})).toArray()
|
|
61
|
+
.filter(({ metaInfo }) => metaInfo !== undefined);
|
|
62
|
+
|
|
63
|
+
printTable(metadataList);
|
|
64
|
+
} catch (err) { console.error(colors.red(err.message)); }
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const headings = async () => {
|
|
68
|
+
try {
|
|
69
|
+
const { data } = await scraping.get("");
|
|
70
|
+
$ = load(data);
|
|
71
|
+
|
|
72
|
+
const headingList = $("h1, h2, h3, h4, h5, h6").map((i, el) => ({
|
|
73
|
+
headingTag: $(el).prop("tagName"),
|
|
74
|
+
headingText: $(el).text()
|
|
75
|
+
})).toArray();
|
|
76
|
+
|
|
77
|
+
printTable(headingList);
|
|
78
|
+
} catch (err) { console.error(colors.red(err.message)); }
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const table_heading = async () => {
|
|
82
|
+
try {
|
|
83
|
+
const { data } = await scraping.get("");
|
|
84
|
+
$ = load(data);
|
|
85
|
+
|
|
86
|
+
const tableHeadList = $("th").map((i, el) => ({
|
|
87
|
+
headingRow: i,
|
|
88
|
+
text: $(el).text()
|
|
89
|
+
})).toArray();
|
|
90
|
+
|
|
91
|
+
tableHeadList.length === 0
|
|
92
|
+
? console.info("no found th tags")
|
|
93
|
+
: printTable(tableHeadList);
|
|
94
|
+
} catch (err) { console.error(colors.red(err.message)); }
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const table_data = async () => {
|
|
98
|
+
try {
|
|
99
|
+
const { data } = await scraping.get("");
|
|
100
|
+
$ = load(data);
|
|
101
|
+
|
|
102
|
+
const tableColumnList = $("td").map((i, el) => $(el).text()).toArray();
|
|
103
|
+
|
|
104
|
+
tableColumnList.length === 0
|
|
105
|
+
? console.info("no found td tags")
|
|
106
|
+
: printTable(tableColumnList);
|
|
107
|
+
} catch (err) { console.error(colors.red(err.message)); }
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
const links = async () => {
|
|
112
|
+
try {
|
|
113
|
+
const { data } = await scraping.get("");
|
|
114
|
+
$ = load(data);
|
|
115
|
+
|
|
116
|
+
const linkList = $("a").map((i, el) => ({
|
|
117
|
+
url: $(el).attr("href"),
|
|
118
|
+
text: $(el).text()
|
|
119
|
+
})).toArray()
|
|
120
|
+
.filter(({ url }) => url.indexOf("#") !== 0);
|
|
121
|
+
|
|
122
|
+
printTable(linkList);
|
|
123
|
+
} catch (err) { console.error(colors.red(err.message)); }
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const cites = async () => {
|
|
127
|
+
try {
|
|
128
|
+
const { data } = await scraping.get("");
|
|
129
|
+
$ = load(data);
|
|
130
|
+
|
|
131
|
+
const citeList = $("q, blockquote").map((i, el) => ({
|
|
132
|
+
citeTag: $(el).prop("tagName"),
|
|
133
|
+
citeLink: $(el).attr("cite"),
|
|
134
|
+
citeText: $(el).text()
|
|
135
|
+
})).toArray();
|
|
136
|
+
|
|
137
|
+
citeList.length === 0
|
|
138
|
+
? console.info("no found q and/or blockquote tags")
|
|
139
|
+
: printTable(citeList);
|
|
140
|
+
} catch (err) { console.error(colors.red(err.message)); }
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
return {
|
|
144
|
+
title,
|
|
145
|
+
images,
|
|
146
|
+
metadata,
|
|
147
|
+
headings,
|
|
148
|
+
table_heading,
|
|
149
|
+
table_data,
|
|
150
|
+
links,
|
|
151
|
+
cites
|
|
152
|
+
};
|
|
153
|
+
}
|