mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-16 20:00:55 +00:00
[IndeedBridge] fix: broken bridge
The html was reworked.
This commit is contained in:
parent
b6d1c7a58f
commit
f766193106
@ -143,24 +143,17 @@ class IndeedBridge extends BridgeAbstract {
|
|||||||
|
|
||||||
$this->title = $html->find('h1', 0)->innertext;
|
$this->title = $html->find('h1', 0)->innertext;
|
||||||
|
|
||||||
// Use local translation of the word "Rating"
|
foreach($html->find('.cmp-ReviewsList div[itemprop="review"]') as $review) {
|
||||||
$rating_local = $html->find('a[data-id="rating_desc"]', 0)->plaintext;
|
|
||||||
|
|
||||||
foreach($html->find('#cmp-content [id^="cmp-review-"]') as $review) {
|
|
||||||
$item = array();
|
$item = array();
|
||||||
|
|
||||||
$rating = $review->find('.cmp-ratingNumber', 0)->plaintext;
|
$title = $review->find('h2[data-testid="title"]', 0)->innertext;
|
||||||
$title = $review->find('.cmp-review-title > span', 0)->plaintext;
|
$rating = $review->find('meta[itemprop="ratingValue"]', 0)->getAttribute('content');
|
||||||
$comment = $this->beautifyComment($review->find('.cmp-review-content-container', 0));
|
$comment = $review->find('span[itemprop="reviewBody"]', 0)->innertext;
|
||||||
|
|
||||||
$item['uri'] = $review->find('.cmp-review-share-popup-item-link--copylink', 0)->href;
|
$item['uri'] = $review->find('a[data-tn-element="individualReviewLink"]', 0)->href;
|
||||||
$item['title'] = "{$rating_local} {$rating} / {$title}";
|
$item['title'] = "$title | ($rating)";
|
||||||
$item['timestamp'] = $review->find('.cmp-review-date-created', 0)->plaintext;
|
$item['author'] = $review->find('span > meta[itemprop="name"]', 0)->getAttribute('content');
|
||||||
$item['author'] = $review->find('.cmp-reviewer', 0)->plaintext;
|
|
||||||
$item['content'] = $comment;
|
$item['content'] = $comment;
|
||||||
//$item['enclosures']
|
|
||||||
$item['categories'][] = $review->find('.cmp-reviewer-job-location', 0)->plaintext;
|
|
||||||
//$item['uid']
|
|
||||||
|
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
|
|
||||||
@ -168,16 +161,7 @@ class IndeedBridge extends BridgeAbstract {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Break if no more pages available.
|
|
||||||
if($next = $html->find('a[data-tn-element="next-page"]', 0)) {
|
|
||||||
$url = $next->href;
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
} while(count($this->items) < $limit);
|
} while(count($this->items) < $limit);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getURI() {
|
public function getURI() {
|
||||||
@ -232,13 +216,4 @@ class IndeedBridge extends BridgeAbstract {
|
|||||||
'limit' => $limit,
|
'limit' => $limit,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function beautifyComment($comment) {
|
|
||||||
foreach($comment->find('.cmp-bold') as $bold) {
|
|
||||||
$bold->tag = 'strong';
|
|
||||||
$bold->removeClass('cmp-bold');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $comment;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user