mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 18:14:44 +02:00
fix: a bunch of small changes in multiple bridges (#2644)
Mostly refactors.
This commit is contained in:
parent
5b7dd45b20
commit
b6e8350596
12 changed files with 81 additions and 46 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue