mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-17 14:18:35 +01:00
[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:
parent
59dd49671d
commit
1cbe1a6f98
@ -3316,6 +3316,7 @@ class HotUKDealsBridge extends PepperBridgeAbstract
|
||||
'and '
|
||||
],
|
||||
'date-prefixes' => [
|
||||
'Posted ',
|
||||
'Found ',
|
||||
'Refreshed ',
|
||||
'Made hot '
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user