@uxf/scripts 11.123.0 → 11.124.0

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/src/Sitemap.js DELETED
@@ -1,60 +0,0 @@
1
- const https = require("https");
2
- const { create } = require("axios");
3
- const cheerio = require("cheerio");
4
-
5
- const { HTTP_USERNAME, HTTP_PASSWORD } = process.env;
6
-
7
- async function getSitemap(xml) {
8
- const { data } = await axios.get(xml);
9
- const $ = cheerio.load(data, { xmlMode: true });
10
-
11
- const urls = [];
12
-
13
- $("loc").each(function () {
14
- urls.push($(this).text());
15
- });
16
-
17
- return urls;
18
- }
19
-
20
- const agent = new https.Agent({
21
- rejectUnauthorized: false,
22
- });
23
-
24
- const axios = create({
25
- auth:
26
- HTTP_PASSWORD && HTTP_USERNAME
27
- ? {
28
- username: HTTP_USERNAME,
29
- password: HTTP_PASSWORD,
30
- }
31
- : undefined,
32
- withCredentials: true,
33
- maxRedirects: 0,
34
- timeout: 20000,
35
- httpsAgent: agent,
36
- headers: {
37
- "User-Agent":
38
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
39
- Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
40
- "Accept-Encoding": "gzip, deflate, br",
41
- "Accept-Language": "en-US,en;q=0.9,cs-CZ;q=0.8,cs;q=0.7,de;q=0.6",
42
- "Cache-Control": "no-cache",
43
- Connection: "keep-alive",
44
- Pragma: "no-cache",
45
- "Sec-Ch-Ua": '"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',
46
- "Sec-Ch-Ua-Arch": '"x86"',
47
- "Sec-Ch-Ua-Mobile": "?0",
48
- "Sec-Ch-Ua-Platform": '"Windows"',
49
- "Sec-Fetch-Dest": "document",
50
- "Sec-Fetch-Mode": "navigate",
51
- "Sec-Fetch-Site": "cross-site",
52
- "Sec-Fetch-User": "?1",
53
- "Sec-Fetch-User-Agent": "?1",
54
- },
55
- });
56
-
57
- module.exports = {
58
- getSitemap,
59
- axios,
60
- };