0
0
mirror of https://github.com/Maks1mS/free-ozon-dpr.git synced 2025-10-21 17:37:30 +03:00

fix globalExpress newline

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

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,