Skip to content

Commit

Permalink
feat: add WKYT bridge (#4337)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattconnell authored Nov 23, 2024
1 parent 2ee615e commit 086ef7f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions bridges/WKYTNewsBridge.php
Original file line number Diff line number Diff line change
@@ -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;
}
}
}

0 comments on commit 086ef7f

Please sign in to comment.