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