diff options
author | 2025-03-02 19:32:33 -0800 | |
---|---|---|
committer | 2025-03-02 19:32:33 -0800 | |
commit | 8b16dd20f6544af3eedf286e23c0d34ab525736c (patch) | |
tree | ec284e22a046c4c8e9626e3fa64a000a2747bf84 /bridges/WKYTNewsBridge.php | |
parent | b183aa798af48af556496c42780d6e844172cf44 (diff) | |
parent | 00a24e2f694a319a5e6cb070dddfff2dae892378 (diff) | |
download | rss-bridge-master.tar.gz rss-bridge-master.tar.zst rss-bridge-master.zip |
Diffstat (limited to 'bridges/WKYTNewsBridge.php')
-rw-r--r-- | bridges/WKYTNewsBridge.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/bridges/WKYTNewsBridge.php b/bridges/WKYTNewsBridge.php new file mode 100644 index 00000000..e3b95f00 --- /dev/null +++ b/bridges/WKYTNewsBridge.php @@ -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; + } + } +} |