[PepperBridgeAbstract] Fix temperature handling (#3828)

Website has changed how the temperature is renderd : the bridge does
follow the new website structure
This commit is contained in:
sysadminstory 2023-12-13 21:09:48 +01:00 committed by GitHub
parent a3b064f4ee
commit 0b67544f86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -117,8 +117,7 @@ class PepperBridgeAbstract extends BridgeAbstract
. $this->getSource($deal)
. $deal->find('div[class*=' . $selectorDescription . ']', 0)->innertext
. '</td><td>'
. $deal->find('div[class*=' . $selectorHot . ']', 0)
->find('span', 0)->outertext
. $this->getTemperature($deal)
. '</td></table>';
// Check if a clock icon is displayed on the deal
@ -368,6 +367,16 @@ HEREDOC;
}
}
/**
* Get the temperature from a Deal if it exists
* @return string String of the deal temperature
*/
private function getTemperature($deal)
{
$data = Json::decode($deal->find('div[class=js-vue2]', 0)->getAttribute('data-vue2'));
return $data['props']['thread']['temperature'] . '°';
}
/**
* Get the source of a Deal if it exists
* @return string String of the deal source