-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ee615e
commit 086ef7f
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |