diff options
Diffstat (limited to 'bridges/CommonDreamsBridge.php')
-rw-r--r-- | bridges/CommonDreamsBridge.php | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/bridges/CommonDreamsBridge.php b/bridges/CommonDreamsBridge.php index 22b9238d..ea21b436 100644 --- a/bridges/CommonDreamsBridge.php +++ b/bridges/CommonDreamsBridge.php @@ -1,26 +1,30 @@ <?php -class CommonDreamsBridge extends FeedExpander { - const MAINTAINER = 'nyutag'; - const NAME = 'CommonDreams Bridge'; - const URI = 'https://www.commondreams.org/'; - const DESCRIPTION = 'Returns the newest articles.'; +class CommonDreamsBridge extends FeedExpander +{ + const MAINTAINER = 'nyutag'; + const NAME = 'CommonDreams Bridge'; + const URI = 'https://www.commondreams.org/'; + const DESCRIPTION = 'Returns the newest articles.'; - public function collectData(){ - $this->collectExpandableDatas('http://www.commondreams.org/rss.xml', 10); - } + public function collectData() + { + $this->collectExpandableDatas('http://www.commondreams.org/rss.xml', 10); + } - protected function parseItem($newsItem){ - $item = parent::parseItem($newsItem); - $item['content'] = $this->extractContent($item['uri']); - return $item; - } + protected function parseItem($newsItem) + { + $item = parent::parseItem($newsItem); + $item['content'] = $this->extractContent($item['uri']); + return $item; + } - private function extractContent($url){ - $html3 = getSimpleHTMLDOMCached($url); - $text = $html3->find('div[class=field--type-text-with-summary]', 0)->innertext; - $html3->clear(); - unset ($html3); - return $text; - } + private function extractContent($url) + { + $html3 = getSimpleHTMLDOMCached($url); + $text = $html3->find('div[class=field--type-text-with-summary]', 0)->innertext; + $html3->clear(); + unset($html3); + return $text; + } } |