mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
[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:
parent
a3b064f4ee
commit
0b67544f86
1 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue