aboutsummaryrefslogtreecommitdiff
path: root/bridges/NFLRUSBridge.php
blob: 18e067a8a47869b137121f7c483ce9c496a62354 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

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';

    public function collectData()
    {
        $html = getSimpleHTMLDOM(self::URI);
        $html = defaultLinkTo($html, self::URI);

        $articles = $html->find('.big-post_content-col');

        foreach ($articles as $article) {
            $item = [];

            $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;
        }
    }
}