NextInpactBridge: Add mention for premium articles
Add mention on article bottom (n% to discover) Minor name fix: Nextinpact -> NextInpact Further code indentation fixes
This commit is contained in:
parent
d7436c2d0a
commit
8b9c40534b
1 changed files with 16 additions and 12 deletions
|
@ -4,10 +4,11 @@
|
|||
* Returns the newest articles
|
||||
* 2014-05-25
|
||||
*
|
||||
* @name Nextinpact Bridge
|
||||
* @name NextInpact Bridge
|
||||
* @homepage http://www.nextinpact.com/
|
||||
* @description Returns the newest articles.
|
||||
* @maintainer qwertygc
|
||||
* @update 2015-09-05
|
||||
*/
|
||||
class NextInpactBridge extends BridgeAbstract {
|
||||
|
||||
|
@ -22,12 +23,15 @@ class NextInpactBridge extends BridgeAbstract {
|
|||
function ExtractContent($url) {
|
||||
$html2 = file_get_html($url);
|
||||
$text = '<p><em>'.$html2->find('span.sub_title', 0)->innertext.'</em></p>'
|
||||
.'<p><img src="'.$html2->find('div.container_main_image_article', 0)->find('img.dedicated',0)->src.'" /></p>'
|
||||
.'<p><img src="'.$html2->find('div.container_main_image_article', 0)->find('img.dedicated',0)->src.'" alt="-" /></p>'
|
||||
.'<div>'.$html2->find('div[itemprop=articleBody]', 0)->innertext.'</div>';
|
||||
$premium_article = $html2->find('h2.title_reserve_article', 0)->innertext;
|
||||
if (strlen($premium_article) > 0)
|
||||
$text = $text.'<p><em>'.$premium_article.'</em></p>';
|
||||
return $text;
|
||||
}
|
||||
|
||||
$html = file_get_html('http://www.nextinpact.com/rss/news.xml') or $this->returnError('Could not request Nextinpact.', 404);
|
||||
$html = file_get_html('http://www.nextinpact.com/rss/news.xml') or $this->returnError('Could not request NextInpact.', 404);
|
||||
$limit = 0;
|
||||
|
||||
foreach($html->find('item') as $element) {
|
||||
|
@ -46,15 +50,15 @@ class NextInpactBridge extends BridgeAbstract {
|
|||
|
||||
}
|
||||
|
||||
public function getName(){
|
||||
public function getName() {
|
||||
return 'Nextinpact Bridge';
|
||||
}
|
||||
|
||||
public function getURI(){
|
||||
public function getURI() {
|
||||
return 'http://www.nextinpact.com/';
|
||||
}
|
||||
|
||||
public function getCacheDuration(){
|
||||
public function getCacheDuration() {
|
||||
return 3600; // 1 hour
|
||||
// return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue