diff options
Diffstat (limited to 'bridges/NFLRUSBridge.php')
-rw-r--r-- | bridges/NFLRUSBridge.php | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/bridges/NFLRUSBridge.php b/bridges/NFLRUSBridge.php index c9a92379..18e067a8 100644 --- a/bridges/NFLRUSBridge.php +++ b/bridges/NFLRUSBridge.php @@ -1,27 +1,28 @@ <?php -class NFLRUSBridge extends BridgeAbstract { +class NFLRUSBridge extends BridgeAbstract +{ + const NAME = 'NFLRUS'; + const URI = 'http://nflrus.ru/'; + const DESCRIPTION = 'Returns the recent articles published on nflrus.ru'; + const MAINTAINER = 'Maxim Shpak'; - const NAME = 'NFLRUS'; - const URI = 'http://nflrus.ru/'; - const DESCRIPTION = 'Returns the recent articles published on nflrus.ru'; - const MAINTAINER = 'Maxim Shpak'; + public function collectData() + { + $html = getSimpleHTMLDOM(self::URI); + $html = defaultLinkTo($html, self::URI); - public function collectData() { - $html = getSimpleHTMLDOM(self::URI); - $html = defaultLinkTo($html, self::URI); + $articles = $html->find('.big-post_content-col'); - $articles = $html->find('.big-post_content-col'); + foreach ($articles as $article) { + $item = []; - foreach($articles as $article) { - $item = array(); + $url = $article->find('.big-post_title.card-title a', 0); - $url = $article->find('.big-post_title.card-title a', 0); - - $item['uri'] = $url->href; - $item['title'] = $url->plaintext; - $item['content'] = $article->find('div', 0)->innertext; - $this->items[] = $item; - } - } + $item['uri'] = $url->href; + $item['title'] = $url->plaintext; + $item['content'] = $article->find('div', 0)->innertext; + $this->items[] = $item; + } + } } |