2022-06-07 05:59:22 +03:00
|
|
|
<?php
|
2022-04-13 00:35:04 +03:00
|
|
|
|
2019-09-16 22:27:01 +03:00
|
|
|
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()
|
2022-07-01 16:10:30 +03:00
|
|
|
{
|
2019-09-16 22:27:01 +03:00
|
|
|
$html = getSimpleHTMLDOM(self::URI);
|
|
|
|
$html = defaultLinkTo($html, self::URI);
|
|
|
|
|
2022-01-02 12:36:09 +03:00
|
|
|
$articles = $html->find('.big-post_content-col');
|
2019-09-16 22:27:01 +03:00
|
|
|
|
2022-04-13 00:35:04 +03:00
|
|
|
foreach ($articles as $article) {
|
|
|
|
$item = [];
|
|
|
|
|
|
|
|
$url = $article->find('.big-post_title.card-title a', 0);
|
|
|
|
|
|
|
|
$item['uri'] = $url->href;
|
|
|
|
$item['title'] = $url->plaintext;
|
2019-09-16 22:27:01 +03:00
|
|
|
$item['content'] = $article->find('div', 0)->innertext;
|
|
|
|
$this->items[] = $item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|