mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-16 13:34:11 +02:00
fix: a bunch of small changes in multiple bridges (#2644)
Mostly refactors.
This commit is contained in:
@@ -17,21 +17,24 @@ class ViadeoCompanyBridge extends BridgeAbstract {
|
||||
));
|
||||
|
||||
public function collectData(){
|
||||
$html = '';
|
||||
$link = self::URI . 'fr/company/' . $this->getInput('c');
|
||||
// Redirects to https://emploi.lefigaro.fr/recherche/entreprises
|
||||
$url = sprintf('%sfr/company/%s', self::URI, $this->getInput('c'));
|
||||
|
||||
$html = getSimpleHTMLDOM($link);
|
||||
$html = getSimpleHTMLDOM($url);
|
||||
|
||||
foreach($html->find('//*[@id="company-newsfeed"]/ul/li') as $element) {
|
||||
// TODO: Fix broken xpath selector
|
||||
$elements = $html->find('//*[@id="company-newsfeed"]/ul/li');
|
||||
|
||||
foreach($elements as $element) {
|
||||
$title = $element->find('p', 0)->innertext;
|
||||
if($title) {
|
||||
$item = array();
|
||||
$item['uri'] = $link;
|
||||
$item['title'] = mb_substr($element->find('p', 0)->innertext, 0, 100);
|
||||
$item['content'] = $element->find('p', 0)->innertext;;
|
||||
$this->items[] = $item;
|
||||
$i++;
|
||||
if(!$title) {
|
||||
continue;
|
||||
}
|
||||
$item = array();
|
||||
$item['uri'] = $url;
|
||||
$item['title'] = mb_substr($element->find('p', 0)->innertext, 0, 100);
|
||||
$item['content'] = $element->find('p', 0)->innertext;;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user