[LinkedInCompanyBridge] add Bridge suffix to class name + code simplification

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-08-29 13:01:44 +02:00
parent 98ebed9bc0
commit c53210b434

View file

@ -1,5 +1,5 @@
<?php <?php
class LinkedInCompany extends BridgeAbstract{ class LinkedInCompanyBridge extends BridgeAbstract{
public $maintainer = "regisenguehard"; public $maintainer = "regisenguehard";
public $name = "LinkedIn Company"; public $name = "LinkedIn Company";
@ -15,9 +15,10 @@ class LinkedInCompany extends BridgeAbstract{
public function collectData(){ public function collectData(){
$html = ''; $html = '';
$link = 'https://www.linkedin.com/company/'.$this->getInput('c'); $link = $this->uri.'company/'.$this->getInput('c');
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request LinkedIn.'); $html = $this->getSimpleHTMLDOM($link)
or $this->returnServerError('Could not request LinkedIn.');
foreach($html->find('//*[@id="my-feed-post"]/li') as $element) { foreach($html->find('//*[@id="my-feed-post"]/li') as $element) {
$title = $element->find('span.share-body', 0)->innertext; $title = $element->find('span.share-body', 0)->innertext;