mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00: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
@ -117,8 +117,7 @@ class PepperBridgeAbstract extends BridgeAbstract
|
|||||||
. $this->getSource($deal)
|
. $this->getSource($deal)
|
||||||
. $deal->find('div[class*=' . $selectorDescription . ']', 0)->innertext
|
. $deal->find('div[class*=' . $selectorDescription . ']', 0)->innertext
|
||||||
. '</td><td>'
|
. '</td><td>'
|
||||||
. $deal->find('div[class*=' . $selectorHot . ']', 0)
|
. $this->getTemperature($deal)
|
||||||
->find('span', 0)->outertext
|
|
||||||
. '</td></table>';
|
. '</td></table>';
|
||||||
|
|
||||||
// Check if a clock icon is displayed on the deal
|
// 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
|
* Get the source of a Deal if it exists
|
||||||
* @return string String of the deal source
|
* @return string String of the deal source
|
||||||
|
Loading…
Reference in New Issue
Block a user