[PepperBridge] Fix date parsing (#3727)

Website changed the date display.
This fix adapt the date parsing to the new website date display
This commit is contained in:
sysadminstory 2023-10-03 23:15:10 +02:00 committed by GitHub
parent 59dd49671d
commit 1cbe1a6f98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -3316,6 +3316,7 @@ class HotUKDealsBridge extends PepperBridgeAbstract
'and '
],
'date-prefixes' => [
'Posted ',
'Found ',
'Refreshed ',
'Made hot '

View File

@ -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();