0
0
mirror of https://github.com/Maks1mS/free-ozon-dpr.git synced 2024-12-23 10:32:58 +03:00

fix globalExpress newline

This commit is contained in:
Maxim Slipenko 2024-06-22 23:16:49 +03:00
parent f6b26f049f
commit cdba0bfa16
5 changed files with 24 additions and 11 deletions

17
package-lock.json generated
View File

@ -19,6 +19,7 @@
},
"devDependencies": {
"@eslint/js": "^9.4.0",
"collapse-white-space": "^2.1.0",
"eslint": "^9.4.0",
"globals": "^15.4.0",
"vite": "^5.2.0",
@ -1093,6 +1094,16 @@
"wrap-ansi": "^6.2.0"
}
},
"node_modules/collapse-white-space": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz",
"integrity": "sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==",
"dev": true,
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
@ -3238,9 +3249,9 @@
"dev": true
},
"node_modules/ws": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz",
"integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==",
"version": "8.17.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
"integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
"engines": {
"node": ">=10.0.0"
},

View File

@ -11,6 +11,7 @@
},
"devDependencies": {
"@eslint/js": "^9.4.0",
"collapse-white-space": "^2.1.0",
"eslint": "^9.4.0",
"globals": "^15.4.0",
"vite": "^5.2.0",

View File

@ -3,6 +3,7 @@ import fs from "node:fs/promises";
import { JSDOM } from "jsdom";
import { asyncMap } from "modern-async";
import { getTelegramMessage } from "../utils.js";
import { collapseWhiteSpace } from "collapse-white-space";
const OUTPUT_FILE = "data/02_global-express.json";
const MAIN_URL = "https://t.me/Mariupol_global_express/1977";
@ -127,8 +128,9 @@ async function getFromTelegram() {
}
const data = await asyncMap(links, async (link) => {
const textContent = link.textContent;
const textContent = collapseWhiteSpace(
link.innerHTML.replace(/<br\s*\/?>/gi, " ")
);
const pvzData = await getPVZFromPost(link.href);
return {
@ -177,8 +179,7 @@ async function globalExpress() {
source: MAIN_URL,
points: points.map((p) => ({
...p,
operationTime:
`<a href="https://vk.com/aliexpress___delivery?w=address-124759560_72654">ГРАФИК РАБОТЫ</a>`,
operationTime: `<a href="https://vk.com/aliexpress___delivery?w=address-124759560_72654">ГРАФИК РАБОТЫ</a>`,
})),
},
undefined,