mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-23 15:06:53 +00:00
Coding policy conformance
A little bit more readability in the code
This commit is contained in:
parent
bb48958518
commit
bfe27c96bc
@ -127,18 +127,37 @@ class DealabsBridge extends BridgeAbstract {
|
|||||||
|
|
||||||
private function getImage($deal)
|
private function getImage($deal)
|
||||||
{
|
{
|
||||||
if($deal->find(
|
|
||||||
'img[class=thread-image width--all-auto height--all-auto imgFrame-img cept-thread-img img--dummy js-lazy-img]', 0) != null) {
|
$selectorLazy = implode(
|
||||||
|
' ', /* Notice this is a space! */
|
||||||
|
array(
|
||||||
|
'thread-image',
|
||||||
|
'width--all-auto',
|
||||||
|
'height--all-auto',
|
||||||
|
'imgFrame-img',
|
||||||
|
'cept-thread-img',
|
||||||
|
'img--dummy',
|
||||||
|
'js-lazy-img'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$selectorPlain = implode(
|
||||||
|
' ', /* Notice this is a space! */
|
||||||
|
array(
|
||||||
|
'thread-image',
|
||||||
|
'width--all-auto',
|
||||||
|
'height--all-auto',
|
||||||
|
'imgFrame-img',
|
||||||
|
'cept-thread-img'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if($deal->find('img[class='. $selectorLazy .']', 0) != null) {
|
||||||
return json_decode(
|
return json_decode(
|
||||||
html_entity_decode(
|
html_entity_decode(
|
||||||
$deal->find(
|
$deal->find('img[class='. $selectorLazy .']', 0)
|
||||||
'img[class=thread-image width--all-auto height--all-auto imgFrame-img cept-thread-img img--dummy js-lazy-img]', 0)
|
|
||||||
->getAttribute('data-lazy-img')))->{'src'};
|
->getAttribute('data-lazy-img')))->{'src'};
|
||||||
} else {
|
} else {
|
||||||
|
return $deal->find('img[class='. $selectorPlain .']', 0 )->src;
|
||||||
return $deal->find(
|
|
||||||
'img[class=thread-image width--all-auto height--all-auto imgFrame-img cept-thread-img]', 0
|
|
||||||
)->src;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,8 +165,7 @@ class DealabsBridge extends BridgeAbstract {
|
|||||||
{
|
{
|
||||||
if($deal->find('span[class=meta-ribbon overflow--wrap-off space--l-3 text--color-greyShade]', 0) != null) {
|
if($deal->find('span[class=meta-ribbon overflow--wrap-off space--l-3 text--color-greyShade]', 0) != null) {
|
||||||
return '<div>'
|
return '<div>'
|
||||||
. $deal->find('span[class=meta-ribbon overflow--wrap-off space--l-3 text--color-greyShade]', 0)
|
. $deal->find('span[class=meta-ribbon overflow--wrap-off space--l-3 text--color-greyShade]', 0)->children(2)->plaintext
|
||||||
->children(2)->plaintext
|
|
||||||
. '</div>';
|
. '</div>';
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
|
Loading…
Reference in New Issue
Block a user