From 1cbe1a6f98ec536be7f894ebcc255d7417c0060b Mon Sep 17 00:00:00 2001 From: sysadminstory Date: Tue, 3 Oct 2023 23:15:10 +0200 Subject: [PATCH] [PepperBridge] Fix date parsing (#3727) Website changed the date display. This fix adapt the date parsing to the new website date display --- bridges/HotUKDealsBridge.php | 1 + bridges/PepperBridgeAbstract.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bridges/HotUKDealsBridge.php b/bridges/HotUKDealsBridge.php index fe4ef507..69301c42 100644 --- a/bridges/HotUKDealsBridge.php +++ b/bridges/HotUKDealsBridge.php @@ -3316,6 +3316,7 @@ class HotUKDealsBridge extends PepperBridgeAbstract 'and ' ], 'date-prefixes' => [ + 'Posted ', 'Found ', 'Refreshed ', 'Made hot ' diff --git a/bridges/PepperBridgeAbstract.php b/bridges/PepperBridgeAbstract.php index 4e520acc..5d2e552b 100644 --- a/bridges/PepperBridgeAbstract.php +++ b/bridges/PepperBridgeAbstract.php @@ -128,9 +128,9 @@ class PepperBridgeAbstract extends BridgeAbstract $clock = end($clocks); // Find the text corresponding to the clock - $spanDateDiv = $clock->parent()->find('span[class=hide--toW3]', 0); - $itemDate = $spanDateDiv->plaintext ?? ''; - // In case of a Local deal, there is no date, but we can use + $spanDateDiv = $clock->next_sibling(); + $itemDate = $spanDateDiv->plaintext; + // In some case of a Local deal, there is no date, but we can use // this case for other reason (like date not in the last field) if ($this->contains($itemDate, $this->i8n('localdeal'))) { $item['timestamp'] = time();