From cb3c40a4fb7053fceee86fb7dbd0da2027242ae5 Mon Sep 17 00:00:00 2001 From: Nigel Nindo Date: Wed, 18 Oct 2023 09:57:21 +0300 Subject: [PATCH] publish raw orbit html --- src/core/scrapping/orbit/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/scrapping/orbit/index.ts b/src/core/scrapping/orbit/index.ts index 4089b5d..d65d39e 100644 --- a/src/core/scrapping/orbit/index.ts +++ b/src/core/scrapping/orbit/index.ts @@ -3,6 +3,7 @@ import { getConfig } from "../../.."; import { BetProvider } from "../../../bet_providers"; import { OrbitProvider } from "../../../bet_providers/orbit"; import { RedisSingleton } from "../../../datastores/redis"; +import { getRedisHtmlParserChannelName } from "../../../utils/redis"; import { PuppeteerPageLoadPolicy } from "../../../utils/types/common"; import { Result } from "../../../utils/types/result_type"; import { getHtmlForScrollingPage } from "../scrolling_scrapper"; @@ -60,6 +61,17 @@ export class OrbitScrapper extends BaseScrapper { if (getHtmlResult.result === "success") { logger.info("Successfully fetched html for url. ", metadata); logger.info(getHtmlResult.value.html); + this.publishRawHtmlToRedis( + getRedisPublisherResult.value, + getRedisHtmlParserChannelName(this.betProvider, game), + { + betProviderName: this.betProvider.name, + betType: game.betType, + fromUrl: game.url, + gameName: game.name, + rawHtml: getHtmlResult.value.html + } + ); } else { logger.error("An error occurred while fetching html for page", metadata); }