mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-30 08:40:24 +03:00
a4b9611e66
- Do not add spaces after opening or before closing parenthesis // Wrong if( !is_null($var) ) { ... } // Right if(!is_null($var)) { ... } - Add space after closing parenthesis // Wrong if(true){ ... } // Right if(true) { ... } - Add body into new line - Close body in new line // Wrong if(true) { ... } // Right if(true) { ... } Notice: Spaces after keywords are not detected: // Wrong (not detected) // -> space after 'if' and missing space after 'else' if (true) { ... } else{ ... } // Right if(true) { ... } else { ... }
37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
class LinkedInCompanyBridge extends BridgeAbstract {
|
|
|
|
const MAINTAINER = 'regisenguehard';
|
|
const NAME = 'LinkedIn Company';
|
|
const URI = 'https://www.linkedin.com/';
|
|
const CACHE_TIMEOUT = 21600; //6
|
|
const DESCRIPTION = 'Returns most recent actus from Company on LinkedIn.
|
|
(https://www.linkedin.com/company/<strong style=\"font-weight:bold;\">apple</strong>)';
|
|
|
|
const PARAMETERS = array( array(
|
|
'c' => array(
|
|
'name' => 'Company name',
|
|
'required' => true
|
|
)
|
|
));
|
|
|
|
public function collectData(){
|
|
$html = '';
|
|
$link = self::URI . 'company/' . $this->getInput('c');
|
|
|
|
$html = getSimpleHTMLDOM($link)
|
|
or returnServerError('Could not request LinkedIn.');
|
|
|
|
foreach($html->find('//*[@id="my-feed-post"]/li') as $element) {
|
|
$title = $element->find('span.share-body', 0)->innertext;
|
|
if($title) {
|
|
$item = array();
|
|
$item['uri'] = $link;
|
|
$item['title'] = mb_substr(strip_tags($element->find('span.share-body', 0)->innertext), 0, 100);
|
|
$item['content'] = strip_tags($element->find('span.share-body', 0)->innertext);
|
|
$this->items[] = $item;
|
|
$i++;
|
|
}
|
|
}
|
|
}
|
|
}
|