From 8b9c40534b2249b7cadd898ccea2af592c31329c Mon Sep 17 00:00:00 2001 From: ORelio Date: Sat, 5 Sep 2015 14:37:52 +0200 Subject: [PATCH] NextInpactBridge: Add mention for premium articles Add mention on article bottom (n% to discover) Minor name fix: Nextinpact -> NextInpact Further code indentation fixes --- bridges/NextInpactBridge.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/bridges/NextInpactBridge.php b/bridges/NextInpactBridge.php index 16126fda..c91a4837 100644 --- a/bridges/NextInpactBridge.php +++ b/bridges/NextInpactBridge.php @@ -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 = '

'.$html2->find('span.sub_title', 0)->innertext.'

' - .'

' + .'

-

' .'
'.$html2->find('div[itemprop=articleBody]', 0)->innertext.'
'; + $premium_article = $html2->find('h2.title_reserve_article', 0)->innertext; + if (strlen($premium_article) > 0) + $text = $text.'

'.$premium_article.'

'; 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,16 +50,16 @@ class NextInpactBridge extends BridgeAbstract { } - public function getName(){ - return 'Nextinpact Bridge'; - } + public function getName() { + return 'Nextinpact Bridge'; + } - public function getURI(){ - return 'http://www.nextinpact.com/'; - } + public function getURI() { + return 'http://www.nextinpact.com/'; + } - public function getCacheDuration(){ - return 3600; // 1 hour + public function getCacheDuration() { + return 3600; // 1 hour // return 0; - } + } }