2022-06-07 04:59:22 +02:00
|
|
|
<?php
|
2022-04-12 23:35:04 +02:00
|
|
|
|
2019-09-16 19:27:01 +00: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 15:10:30 +02:00
|
|
|
{
|
2019-09-16 19:27:01 +00:00
|
|
|
$html = getSimpleHTMLDOM(self::URI);
|
|
|
|
$html = defaultLinkTo($html, self::URI);
|
|
|
|
|
2022-01-02 14:36:09 +05:00
|
|
|
$articles = $html->find('.big-post_content-col');
|
2019-09-16 19:27:01 +00:00
|
|
|
|
2022-04-12 23:35:04 +02: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 19:27:01 +00:00
|
|
|
$item['content'] = $article->find('div', 0)->innertext;
|
|
|
|
$this->items[] = $item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|