mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-12-19 01:20:58 +03:00
feat: add WKYT bridge (#4337)
This commit is contained in:
parent
2ee615e588
commit
086ef7f8a7
1 changed files with 27 additions and 0 deletions
27
bridges/WKYTNewsBridge.php
Normal file
27
bridges/WKYTNewsBridge.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
class WKYTNewsBridge extends BridgeAbstract
|
||||
{
|
||||
const NAME = 'WKYT Lexington News';
|
||||
const URI = 'https://www.wkyt.com/news/';
|
||||
const DESCRIPTION = 'Returns the recent articles published on WKYT News (Lexington KY)';
|
||||
const MAINTAINER = 'mattconnell';
|
||||
|
||||
public function collectData()
|
||||
{
|
||||
$html = getSimpleHTMLDOM(self::URI);
|
||||
$html = defaultLinkTo($html, self::URI);
|
||||
|
||||
$articles = $html->find('.card-body');
|
||||
|
||||
foreach ($articles as $article) {
|
||||
$item = [];
|
||||
$url = $article->find('.headline a', 0);
|
||||
$item['uri'] = $url->href;
|
||||
$item['title'] = trim($url->plaintext);
|
||||
$item['author'] = $article->find('.author', 0)->plaintext;
|
||||
$item['content'] = $article->find('.deck', 0)->plaintext;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue